mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
mobile: cleanup
This commit is contained in:
committed by
Abdullah Atta
parent
e84afd37a8
commit
b0e304bcea
@@ -111,10 +111,7 @@ async function onBackgroundSyncStarted() {
|
||||
try {
|
||||
if (!db.isInitialized) {
|
||||
await db.init();
|
||||
} else {
|
||||
await db.initCollections();
|
||||
}
|
||||
|
||||
const user = await db.user?.getUser();
|
||||
if (user) {
|
||||
await db.sync(true, false);
|
||||
@@ -130,14 +127,13 @@ async function onBackgroundSyncStarted() {
|
||||
const onBoot = async () => {
|
||||
try {
|
||||
if (!SettingsService.getProperty("backgroundSync")) {
|
||||
DatabaseLogger.info("BACKGROUND SYNC ON BOOT DISABLED");
|
||||
return;
|
||||
}
|
||||
|
||||
DatabaseLogger.info("BOOT TASK STARTED");
|
||||
if (!db.isInitialized) {
|
||||
await db.init();
|
||||
} else {
|
||||
await db.initCollections();
|
||||
}
|
||||
|
||||
await Notifications.setupReminders();
|
||||
@@ -147,6 +143,7 @@ const onBoot = async () => {
|
||||
}
|
||||
DatabaseLogger.info("BOOT TASK COMPLETE");
|
||||
} catch (e) {
|
||||
DatabaseLogger.error(e as Error);
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,10 +25,7 @@ import { MMKV } from "../app/common/database/mmkv";
|
||||
export async function initDatabase() {
|
||||
if (!db.isInitialized) {
|
||||
await db.init();
|
||||
} else {
|
||||
await db.initCollections();
|
||||
}
|
||||
await db.notes.init();
|
||||
}
|
||||
|
||||
const StorageKeys = {
|
||||
|
||||
Reference in New Issue
Block a user