Skip to content

Commit

Permalink
fix: EditAccountAndPassword not showing error
Browse files Browse the repository at this point in the history
...when invalid credentials are provided,
making it seem like you could actually change password

The bug was introduced in
#3849
136992d

Tested shallowly. Works alright.

Also added error dialog for "instant onboarding" just in case
(did not test it this though).
  • Loading branch information
WofWca committed Jul 17, 2024
1 parent d7794fd commit bb46633
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- fix update unread badge on when muting / unmuting a chat #4020
- fix update unread badge on receiving device messages #4020
- fix target chat was not opened on notification click #3983
- fix "Password and Account" dialog not indicating invalid credentials, making it seem that you can change password like this #4032

<a id="1_46_1"></a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import useDialog from '../../hooks/dialog/useDialog'
import useConfirmationDialog from '../../hooks/dialog/useConfirmationDialog'

import type { DialogProps } from '../../contexts/DialogContext'
import AlertDialog from './AlertDialog'

export default function EditAccountAndPasswordDialog({ onClose }: DialogProps) {
const tx = useTranslationFunction()
Expand Down Expand Up @@ -92,7 +93,9 @@ function EditAccountInner(onClose: DialogProps['onClose']) {
openDialog(ConfigureProgressDialog, {
credentials: accountSettings,
onSuccess,
onFail: () => {},
onFail: error => {
openDialog(AlertDialog, { message: error })
},
})
}

Expand Down
5 changes: 4 additions & 1 deletion src/renderer/hooks/useInstantOnboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
VerifyContactQr,
VerifyGroupQr,
} from '../backend/qr'
import AlertDialog from '../components/dialogs/AlertDialog'

type InstantOnboarding = {
createInstantAccount: (accountId: number) => Promise<T.FullChat['id'] | null>
Expand Down Expand Up @@ -135,7 +136,9 @@ export default function useInstantOnboarding(): InstantOnboarding {
reject(error)
}
},
onFail: () => {},
onFail: error => {
openDialog(AlertDialog, { message: error })
},
})
})
},
Expand Down

0 comments on commit bb46633

Please sign in to comment.