mirror of
https://github.com/nestriness/nestri.git
synced 2026-11-03 22:22:39 +02:00
fix(auth): show one alert at a time on the code screen
A wrong code showed "Invalid code" above "Code sent to ...", two answers to one question in two colours. An error now replaces the confirmation instead of joining it.
This commit is contained in:
@@ -156,12 +156,14 @@ export function CodeUI(props: CodeUIOptions): CodeProviderOptions {
|
||||
|
||||
if (error?.type === 'invalid_code')
|
||||
alerts.push({ tone: 'danger', message: copy.code_invalid });
|
||||
// Said after any error, so a person who mistyped still sees which
|
||||
// address the code they are looking for actually went to.
|
||||
alerts.push({
|
||||
tone: 'success',
|
||||
message: (state.resend ? copy.code_resent : copy.code_sent) + state.claims[mode]
|
||||
});
|
||||
// One banner, the newest thing that happened. "Code sent" under
|
||||
// "Invalid code" reads as two answers to one question, and the
|
||||
// address is still on the email itself.
|
||||
if (alerts.length === 0)
|
||||
alerts.push({
|
||||
tone: 'success',
|
||||
message: (state.resend ? copy.code_resent : copy.code_sent) + state.claims[mode]
|
||||
});
|
||||
|
||||
return {
|
||||
kind: 'form',
|
||||
|
||||
Reference in New Issue
Block a user