mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 14:51:12 -05:00
Refactor: Improve validation schemas
This commit is contained in:
@@ -157,9 +157,17 @@ export function EmailChangeDialog({ open, onOpenChange, currentEmail, userId }:
|
||||
setStep('success');
|
||||
} catch (error: any) {
|
||||
console.error('Email change error:', error);
|
||||
toast.error('Failed to change email', {
|
||||
description: error.message || 'Please try again.',
|
||||
});
|
||||
|
||||
// Handle rate limiting specifically
|
||||
if (error.message?.includes('rate limit') || error.status === 429) {
|
||||
toast.error('Too Many Attempts', {
|
||||
description: 'Please wait a few minutes before trying again.',
|
||||
});
|
||||
} else {
|
||||
toast.error('Failed to change email', {
|
||||
description: error.message || 'Please try again.',
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user