Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/IconicPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,11 @@ export default class IconicPlugin extends Plugin {
const backupPath = normalizePath(dataPath + '.backup');
const { adapter } = this.app.vault;

// Disable automatic backups when set to "none"
if (this.settings.maxBackups <= 0) {
return;
}

// Determine if a new backup is due for creation
const backupStat = await adapter.stat(backupPath + 1);
const isDueForBackup = !backupStat || Date.now() - backupStat.mtime >= HOUR * 3;
Expand Down