another way to deal with trash

This commit is contained in:
fyears 2022-02-24 00:29:16 +08:00
parent 82d455f8bf
commit c9d3a05ca1

View File

@ -85,7 +85,6 @@ export default class RemotelySavePlugin extends Plugin {
currSyncMsg?: string;
syncRibbon?: HTMLElement;
autoRunIntervalID?: number;
ignoreAutoRemovedRecords?: Record<string, number>;
async syncRun(triggerSource: SyncTriggerSourceType = "manual") {
const getNotice = (x: string) => {
@ -266,8 +265,6 @@ export default class RemotelySavePlugin extends Plugin {
revokeAuthSetting: undefined,
}; // init
this.ignoreAutoRemovedRecords = {};
this.currSyncMsg = "";
await this.loadSettings();
@ -643,9 +640,7 @@ export default class RemotelySavePlugin extends Plugin {
}
async trash(x: string) {
this.ignoreAutoRemovedRecords[x] = Date.now();
if (!(await this.app.vault.adapter.trashSystem(x))) {
this.ignoreAutoRemovedRecords[x] = Date.now();
await this.app.vault.adapter.trashLocal(x);
}
}