Only throw unexpected errors from openDb

This commit is contained in:
Julia Friesel
2018-10-30 09:14:46 +01:00
parent 7cadb01b13
commit 207b5504e7
3 changed files with 17 additions and 13 deletions
@@ -3,10 +3,8 @@ import { openDb } from '../../../db'
import { shared } from '../../labels'
export default async function checkPassword({hash, onCancel, onTryAgain }) {
try {
await openDb({ hash, persistConnection: false })
return true
} catch (err) {
const connected = await openDb({ hash, persistConnection: false })
if (!connected) {
Alert.alert(
shared.incorrectPassword,
shared.incorrectPasswordMessage,