add dbx clearlocal

This commit is contained in:
fyears 2022-04-02 00:01:20 +08:00
parent 953507ec43
commit 510f0c2081
2 changed files with 23 additions and 1 deletions

@ -1 +1 @@
Subproject commit c729c117e810fd6e01c52fe6af4f7c4764f19e48 Subproject commit 9a4c2d3c1c444577b4a4412e9f37f263ce3ebcb3

View File

@ -1013,6 +1013,28 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
}); });
}); });
new Setting(dropboxRevokeAuthDiv)
.setName(t("settings_dropbox_clearlocal"))
.setDesc(t("settings_dropbox_clearlocal_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_dropbox_clearlocal_button"));
button.onClick(async () => {
this.plugin.settings.dropbox = JSON.parse(
JSON.stringify(DEFAULT_DROPBOX_CONFIG)
);
await this.plugin.saveSettings();
dropboxAuthDiv.toggleClass(
"dropbox-auth-button-hide",
this.plugin.settings.dropbox.username !== ""
);
dropboxRevokeAuthDiv.toggleClass(
"dropbox-revoke-auth-button-hide",
this.plugin.settings.dropbox.username === ""
);
new Notice(t("settings_dropbox_clearlocal_notice"));
});
});
new Setting(dropboxAuthDiv) new Setting(dropboxAuthDiv)
.setName(t("settings_dropbox_auth")) .setName(t("settings_dropbox_auth"))
.setDesc(t("settings_dropbox_auth_desc")) .setDesc(t("settings_dropbox_auth_desc"))