diff --git a/app/lib/database/appGroup.ts b/app/lib/database/appGroup.ts index 0a5a66066..641090efa 100644 --- a/app/lib/database/appGroup.ts +++ b/app/lib/database/appGroup.ts @@ -1,11 +1,5 @@ -import { NativeModules } from 'react-native'; - -import { isIOS } from '../methods/helpers'; +import { NativeModules, Platform } from 'react-native'; const { AppGroup } = NativeModules; -const appGroup: { path: string } = { - path: isIOS ? AppGroup.path : '' -}; - -export default appGroup; +export const appGroupPath: string = Platform.OS === 'ios' ? AppGroup.path : ''; diff --git a/app/lib/database/index.ts b/app/lib/database/index.ts index 5175810dd..dfcf21a2f 100644 --- a/app/lib/database/index.ts +++ b/app/lib/database/index.ts @@ -2,8 +2,7 @@ import { Database } from '@nozbe/watermelondb'; import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite'; import logger from '@nozbe/watermelondb/utils/common/logger'; -import { isIOS } from '../methods/helpers'; -import appGroup from './appGroup'; +import { appGroupPath } from './appGroup'; import { isOfficial } from '../constants'; import Subscription from './model/Subscription'; import Room from './model/Room'; @@ -27,10 +26,8 @@ import migrations from './model/migrations'; import serversMigrations from './model/servers/migrations'; import { TAppDatabase, TServerDatabase } from './interfaces'; -const appGroupPath = isIOS ? appGroup.path : ''; - -if (__DEV__ && isIOS) { - console.log(appGroupPath); +if (__DEV__) { + console.log(`📂 ${appGroupPath}`); } const getDatabasePath = (name: string) => `${appGroupPath}${name}${isOfficial ? '' : '-experimental'}.db`;