diff --git a/squarenotsquare/src/realm/dbInit.js b/squarenotsquare/src/realm/dbInit.js index 2bceb17..a372780 100644 --- a/squarenotsquare/src/realm/dbInit.js +++ b/squarenotsquare/src/realm/dbInit.js @@ -18,9 +18,9 @@ import { migratev1 } from "./migrations/MigrateV1"; import {generateKey} from '../libs/Random'; import * as KeyStore from '../services/Keystore'; -let systemRepo = null; -let scoreRepo = null; -let userRepo = null; +export let systemRepo = null; +export let scoreRepo = null; +export let userRepo = null; export async function initDB(dbKeyRef = 'squareDB', dbLocation = Realm.defaultPath){ try { @@ -65,9 +65,12 @@ export async function initDB(dbKeyRef = 'squareDB', dbLocation = Realm.defaultPa userRepo = new UserRepo(dbRef); scoreRepo = new ScoreRepo(dbRef); - return dbRef; + return { + systemRepo: systemRepo, + userRepo: userRepo, + scoreRepo: scoreRepo + }; } catch (err) { - console.log(err); return null; } } \ No newline at end of file