err msg stays longer

This commit is contained in:
fyears 2022-03-22 00:31:17 +08:00
parent 76127dd131
commit 575a27db26

View File

@ -101,11 +101,11 @@ export default class RemotelySavePlugin extends Plugin {
return this.i18n.t(x, vars); return this.i18n.t(x, vars);
}; };
const getNotice = (x: string) => { const getNotice = (x: string, timeout?: number) => {
// only show notices in manual mode // only show notices in manual mode
// no notice in auto mode // no notice in auto mode
if (triggerSource === "manual" || triggerSource === "dry") { if (triggerSource === "manual" || triggerSource === "dry") {
new Notice(x); new Notice(x, timeout);
} }
}; };
if (this.syncStatus !== "idle") { if (this.syncStatus !== "idle") {
@ -331,8 +331,8 @@ export default class RemotelySavePlugin extends Plugin {
}); });
log.info(msg); log.info(msg);
log.info(error); log.info(error);
getNotice(msg); getNotice(msg, 10 * 1000);
getNotice(error.message); getNotice(error.message, 10 * 1000);
this.syncStatus = "idle"; this.syncStatus = "idle";
if (this.syncRibbon !== undefined) { if (this.syncRibbon !== undefined) {
setIcon(this.syncRibbon, iconNameSyncWait); setIcon(this.syncRibbon, iconNameSyncWait);