diff --git a/src/ObsidianLiveSyncSettingTab.ts b/src/ObsidianLiveSyncSettingTab.ts index fd7b5d3..6da3fc4 100644 --- a/src/ObsidianLiveSyncSettingTab.ts +++ b/src/ObsidianLiveSyncSettingTab.ts @@ -1657,6 +1657,22 @@ ${stringifyYaml(pluginConfig)}`; } Logger(`Converting finished`, LOG_LEVEL_NOTICE); })); + + new Setting(containerHatchEl) + .setName("Delete all customization sync data") + .addButton((button) => + button + .setButtonText("Delete") + .setDisabled(false) + .setWarning() + .onClick(async () => { + Logger(`Deleting customization sync data`, LOG_LEVEL_NOTICE); + const entriesToDelete = (await this.plugin.localDatabase.allDocsRaw({ startkey: "ix:", endkey: "ix:\u{10ffff}", include_docs: true })); + const newData = entriesToDelete.rows.map(e => ({ ...e.doc, _deleted: true })); + const r = await this.plugin.localDatabase.bulkDocsRaw(newData as any[]); + // Do not care about the result. + Logger(`${r.length} items have been removed, to confirm how many items are left, please perform it again.`, LOG_LEVEL_NOTICE); + })) new Setting(containerHatchEl) .setName("Suspend file watching") .setDesc("Stop watching for file change.") diff --git a/src/lib b/src/lib index ec3229a..609c7ae 160000 --- a/src/lib +++ b/src/lib @@ -1 +1 @@ -Subproject commit ec3229a819edabcd543ce7154361540f56f363e9 +Subproject commit 609c7aecf30aba4da1eeb8b6ea945be3de514c05