Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix auto backups not working

ammarahm-ede364315bfaec
diff --git a/apps/mobile/src/components/launcher/index.js b/apps/mobile/src/components/launcher/index.js
index 716584fda..fc6c8bd2b 100644
--- a/apps/mobile/src/components/launcher/index.js
+++ b/apps/mobile/src/components/launcher/index.js
@@ -117,7 +117,7 @@ const Launcher = React.memo(
if (SettingsService.get().reminder === 'off') {
SettingsService.set({ reminder: 'daily' });
}
- if (BackupService.checkBackupRequired()) {
+ if (await BackupService.checkBackupRequired(SettingsService.get().reminder)) {
sleep(2000).then(() => BackupService.run());
}
}
diff --git a/apps/mobile/src/services/backup.js b/apps/mobile/src/services/backup.js
index 4d6fe7298..9dc6ff3be 100644
--- a/apps/mobile/src/services/backup.js
+++ b/apps/mobile/src/services/backup.js
@@ -210,20 +210,18 @@ async function checkBackupRequired(type) {
return true;
}
lastBackupDate = parseInt(lastBackupDate);
-
if (type === 'daily' && lastBackupDate + MS_DAY < now) {
- console.log('daily');
+ console.log('daily backup started');
return true;
} else if (type === 'weekly' && lastBackupDate + MS_WEEK < now) {
- console.log('weekly');
+ console.log('weekly backup started');
return true;
} else if (type === 'monthly' && lastBackupDate + MONTH < now) {
- console.log('monthly');
+ console.log('monthly backup started');
return true;
- } else {
- console.log('no need', lastBackupDate);
- return false;
}
+ console.log('no need', lastBackupDate);
+ return false;
}
const checkAndRun = async () => {