mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Fix sign out after force quit in Android (#375)
Removes intentional Realm file deletion to avoid unintentional Realm file deletion, though the latter remains something of a mystery. * Configure Realm with the full path to the file * Remove all Realm.open calls in AuthenticationService in favor of passing the context/provider copy of realm (only one realm instance) * Only delete the realm file on sign out if deleting realm contents fails for some reason * Replaced deleteRealm with semantically more accurate clearRealm Closes #373
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import RNFS from "react-native-fs";
|
||||
import {
|
||||
consoleTransport,
|
||||
fileAsyncTransport,
|
||||
logger
|
||||
} from "react-native-logs";
|
||||
@@ -7,8 +8,16 @@ import {
|
||||
const fileName = "inaturalist-rn-log.txt";
|
||||
const logFilePath = `${RNFS.DocumentDirectoryPath}/${fileName}`;
|
||||
|
||||
// Configure without transport for test. If you want to write output during
|
||||
// tests, use console.log
|
||||
const transport = [];
|
||||
if ( process?.env?.NODE_ENV !== "test" ) {
|
||||
transport.push( consoleTransport );
|
||||
transport.push( fileAsyncTransport );
|
||||
}
|
||||
|
||||
const config = {
|
||||
transport: fileAsyncTransport,
|
||||
transport,
|
||||
transportOptions: {
|
||||
FS: RNFS,
|
||||
fileName
|
||||
|
||||
Reference in New Issue
Block a user