Password verification bug fix
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user