Skip to content

Commit

Permalink
fix: resend otp copy
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiir committed Dec 28, 2023
1 parent 1be9a2d commit 33fec88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class W3mEmailVerifyDeviceView extends LitElement {
}
this.loading = true
await this.emailConnector.provider.connectEmail({ email: this.email })
SnackController.showSuccess('New Email sent')
SnackController.showSuccess('Code email resent')
}
} catch (error) {
SnackController.showError(error)
Expand Down
10 changes: 5 additions & 5 deletions packages/scaffold/src/views/w3m-email-verify-otp-view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export class W3mEmailVerifyOtpView extends LitElement {
throw new Error('w3m-email-verify-otp-view: No email provided')
}

const isResendDisabled = Boolean(this.timeoutTimeLeft)

return html`
<wui-flex
flexDirection="column"
Expand All @@ -74,10 +76,8 @@ export class W3mEmailVerifyOtpView extends LitElement {
<wui-flex alignItems="center">
<wui-text variant="small-400" color="fg-200">Didn't receive it?</wui-text>
<wui-link
@click=${this.onResendCode.bind(this)}
.disabled=${Boolean(this.timeoutTimeLeft)}
>Resend ${this.timeoutTimeLeft > 0 ? `in ${this.timeoutTimeLeft}s` : 'Code'}</wui-link
<wui-link @click=${this.onResendCode.bind(this)} .disabled=${isResendDisabled}
>Resend ${isResendDisabled ? `in ${this.timeoutTimeLeft}s` : 'Code'}</wui-link
>
</wui-flex>
</wui-flex>
Expand Down Expand Up @@ -116,7 +116,7 @@ export class W3mEmailVerifyOtpView extends LitElement {
}
this.loading = true
await emailConnector.provider.connectEmail({ email: this.email })
SnackController.showSuccess('New Email sent')
SnackController.showSuccess('Code email resent')
}
} catch (error) {
SnackController.showError(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class W3mUpdateEmailWalletWaitingView extends LitElement {
this.loading = true
await this.emailConnector.provider.updateEmail({ email: this.email })
this.listenForEmailUpdateApproval()
SnackController.showSuccess('New Email sent')
SnackController.showSuccess('Code email resent')
}
} catch (error) {
SnackController.showError(error)
Expand Down

0 comments on commit 33fec88

Please sign in to comment.