[FIX] Fix require cycle for appGroupPath (#4298)
* fix require cycle for appGroupPath * add console log
This commit is contained in:
parent
79cd150231
commit
74a82974f0
|
@ -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 : '';
|
||||
|
|
|
@ -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`;
|
||||
|
|
Loading…
Reference in New Issue