diff --git a/components/settings/password/check-current-password.js b/components/settings/password/check-current-password.js index 76ddc94..92d78bf 100644 --- a/components/settings/password/check-current-password.js +++ b/components/settings/password/check-current-password.js @@ -3,18 +3,21 @@ import { openDb } from '../../../db' import { shared } from '../../../i18n/en/labels' export default async function checkPassword({hash, onCancel, onTryAgain }) { - const connected = await openDb(hash) - if (connected) return true - Alert.alert( - shared.incorrectPassword, - shared.incorrectPasswordMessage, - [{ - text: shared.cancel, - onPress: onCancel - }, { - text: shared.tryAgain, - onPress: onTryAgain - }] - ) - return false + try { + await openDb(hash) + return true + } catch (err) { + Alert.alert( + shared.incorrectPassword, + shared.incorrectPasswordMessage, + [{ + text: shared.cancel, + onPress: onCancel + }, { + text: shared.tryAgain, + onPress: onTryAgain + }] + ) + return false + } } \ No newline at end of file