diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -5,7 +5,7 @@ import { Platform } from 'react-native'; import Orientation from 'react-native-orientation-locker'; import { createTransform } from 'redux-persist'; -import type { Transform } from 'redux-persist/es/types.js'; +import type { Transform, Persistor } from 'redux-persist/es/types.js'; import { convertEntryStoreToNewIDSchema, @@ -1259,7 +1259,7 @@ function setPersistor(persistor: *) { storedPersistor = persistor; } -function getPersistor(): empty { +function getPersistor(): Persistor { invariant(storedPersistor, 'should be set'); return storedPersistor; } diff --git a/native/utils/crash-utils.js b/native/utils/crash-utils.js --- a/native/utils/crash-utils.js +++ b/native/utils/crash-utils.js @@ -12,12 +12,12 @@ async function wipeAndExit() { await Promise.all([ - getPersistor().purge(), __DEV__ ? AsyncStorage.removeItem(navStateAsyncStorageKey) : null, AsyncStorage.removeItem('ANDROID_REFERRER'), AsyncStorage.removeItem(featureFlagsStorageKey), clearSensitiveData(), ]); + await getPersistor().purge(); await sleep(50); commCoreModule.terminate(); }