mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2024-12-15 09:14:07 +02:00
New feature:
- We can delete all data of customization sync from the `Delete all customization sync data` on the `Hatch` pane. Fixed: - Prevent keep restarting on iOS by yielding microtasks.
This commit is contained in:
parent
dd7a40630b
commit
79754f48d6
@ -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.")
|
||||
|
2
src/lib
2
src/lib
@ -1 +1 @@
|
||||
Subproject commit ec3229a819edabcd543ce7154361540f56f363e9
|
||||
Subproject commit 609c7aecf30aba4da1eeb8b6ea945be3de514c05
|
Loading…
Reference in New Issue
Block a user