Password verification bug fix

This commit is contained in:
mashazyu
2019-01-05 11:25:43 +01:00
parent dd539e50fe
commit 4e74dd9a5a
@@ -3,18 +3,21 @@ import { openDb } from '../../../db'
import { shared } from '../../../i18n/en/labels' import { shared } from '../../../i18n/en/labels'
export default async function checkPassword({hash, onCancel, onTryAgain }) { export default async function checkPassword({hash, onCancel, onTryAgain }) {
const connected = await openDb(hash) try {
if (connected) return true await openDb(hash)
Alert.alert( return true
shared.incorrectPassword, } catch (err) {
shared.incorrectPasswordMessage, Alert.alert(
[{ shared.incorrectPassword,
text: shared.cancel, shared.incorrectPasswordMessage,
onPress: onCancel [{
}, { text: shared.cancel,
text: shared.tryAgain, onPress: onCancel
onPress: onTryAgain }, {
}] text: shared.tryAgain,
) onPress: onTryAgain
return false }]
)
return false
}
} }