Add react-native-exit-app-v2

This commit is contained in:
Maria Zadnepryanets
2022-06-19 18:21:19 +02:00
committed by Sofiya Tepikin
parent 829b4bf242
commit d8c4278fec
3 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -2,7 +2,10 @@ import Realm from 'realm'
import { LocalDate, ChronoUnit } from 'js-joda'
import nodejs from 'nodejs-mobile-react-native'
import fs from 'react-native-fs'
import restart from 'react-native-restart'
// Current version of react-native-restart doesn't work with our ios setup
// therefore react-native-exit-app-v2 is used to close the app after setting pwd
// import restart from 'react-native-restart'
import RNExitApp from 'react-native-exit-app-v2'
import schemas from './schemas'
import cycleModule from '../lib/cycle'
import maybeSetNewCycleStart from '../lib/set-new-cycle-start'
@@ -213,7 +216,10 @@ export async function changeEncryptionAndRestartApp(hash) {
db.close()
await fs.unlink(defaultPath)
await fs.moveFile(copyPath, defaultPath)
restart.Restart()
// Current version of react-native-restart doesn't work with our ios setup
// therefore react-native-exit-app-v2 is used to close the app after setting pwd
// restart.Restart()
RNExitApp.exitApp()
}
export function isDbEmpty() {