Skip to content

Commit

Permalink
Fix and add optional chain when accessing authStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickey9315 authored and Mickey9315 committed Apr 19, 2021
1 parent ba7ea0a commit 53938f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/views/auth/forgot_password/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ForgotPassword = () => {
return (
<div className="forgot_password">
{forgotPWStatus.message && (
<h5 className={`text-center ${authStatus.success ? 'toast-success' : 'toast-error'}`}>
<h5 className={`text-center ${authStatus?.success ? 'toast-success' : 'toast-error'}`}>
{authStatus.message}
</h5>
)}
Expand All @@ -47,17 +47,20 @@ const ForgotPassword = () => {
<input
field="email"
required
className="input-form"
label="* Email"
maxLength={40}
onInputChange={onEmailChange}
onChange={onEmailChange}
placeholder="Enter your email"
readOnly={isSendingForgotPWRequest || authStatus.success}
readOnly={isSendingForgotPWRequest || authStatus?.success}
type="email"
style={{ width: '100%' }}
/>
<br />
<br />
<button
className="button w-100-mobile"
disabled={isSendingForgotPWRequest || authStatus.success}
disabled={isSendingForgotPWRequest || authStatus?.success}
onClick={onSubmitEmail}
type="button"
>
Expand Down

0 comments on commit 53938f8

Please sign in to comment.