mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
fix auto backups not working
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user