allow clearing sync mappings

This commit is contained in:
fyears
2021-11-07 16:02:03 +08:00
parent d7d1c47e2a
commit b7a0376a0f
2 changed files with 30 additions and 1 deletions
+25 -1
View File
@@ -11,7 +11,11 @@ import {
TFolder,
} from "obsidian";
import * as CodeMirror from "codemirror";
import { clearAllSyncPlanRecords, DatabaseConnection } from "./localdb";
import {
clearAllSyncPlanRecords,
clearAllSyncMetaMapping,
DatabaseConnection,
} from "./localdb";
import {
prepareDBs,
destroyDBs,
@@ -318,5 +322,25 @@ class SaveRemoteSettingTab extends PluginSettingTab {
new Notice("sync plans history (in db) deleted");
});
});
const syncMappingDiv = containerEl.createEl("div");
syncMappingDiv.createEl("p", {
text: "Sync mappings history stores the actual LOCAL last modified time of the REMOTE objects.",
});
syncMappingDiv.createEl("p", {
text: "If the sync mappings history are deleted, unnecessary data exchanges may occur in next-time syncing, because whether a remote object and local object with same name are equivalent or not could not be determined correctly by comparing last modified times.",
});
new Setting(containerEl)
.setName("delete sync mappings history in db")
.setDesc("delete sync mappings history in db")
.addButton(async (button) => {
button.setButtonText("Delete Sync Mappings");
button.onClick(async () => {
await clearAllSyncMetaMapping(this.plugin.db);
new Notice("sync mappings history (in local db) deleted");
});
});
}
}