mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-17 21:53:03 +05:30
#102: countdown for email frequency error in ResendActivation
This commit is contained in:
parent
25eeac6074
commit
9fa7cd7b8e
@ -14,12 +14,8 @@ export default function AuthError({error, onClose = function() {}}) {
|
|||||||
resetTimer();
|
resetTimer();
|
||||||
|
|
||||||
if (error.payload && error.payload.canRepeatIn) {
|
if (error.payload && error.payload.canRepeatIn) {
|
||||||
if (error.payload && error.payload.canRepeatIn) {
|
error.payload.msLeft = error.payload.canRepeatIn * 1000;
|
||||||
error.payload.msLeft = error.payload.canRepeatIn * 1000;
|
setTimeout(onClose, error.payload.msLeft - Date.now() + 1500); // 1500 to let the user see, that time is elapsed
|
||||||
setTimeout(onClose, error.payload.msLeft - Date.now() + 1500); // 1500 to let the user see, that time is elapsed
|
|
||||||
} else {
|
|
||||||
// TODO: it would be greate to log this case, when we will setup frontend logging
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -70,8 +70,10 @@ const errorsMap = {
|
|||||||
'error.account_not_activated': () => <Message {...messages.accountNotActivated} />,
|
'error.account_not_activated': () => <Message {...messages.accountNotActivated} />,
|
||||||
|
|
||||||
'error.email_frequency': (props) => <Message {...messages.emailFrequency} values={{
|
'error.email_frequency': (props) => <Message {...messages.emailFrequency} values={{
|
||||||
|
// for msLeft @see AuthError.jsx
|
||||||
time: <Relative value={props.msLeft} updateInterval={1000} />
|
time: <Relative value={props.msLeft} updateInterval={1000} />
|
||||||
}} />,
|
}} />,
|
||||||
|
'error.recently_sent_message': (props) => errorsMap['error.email_frequency'](props),
|
||||||
|
|
||||||
'error.email_not_found': () => <Message {...messages.emailNotFound} />,
|
'error.email_not_found': () => <Message {...messages.emailNotFound} />,
|
||||||
'error.account_already_activated': () => <Message {...messages.accountAlreadyActivated} />,
|
'error.account_already_activated': () => <Message {...messages.accountAlreadyActivated} />,
|
||||||
|
Loading…
Reference in New Issue
Block a user