From 575a27db263cfea44ae33b894b02fefe95c92c4a Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Tue, 22 Mar 2022 00:31:17 +0800 Subject: [PATCH] err msg stays longer --- src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 4c9d018..ab5b6c7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -101,11 +101,11 @@ export default class RemotelySavePlugin extends Plugin { return this.i18n.t(x, vars); }; - const getNotice = (x: string) => { + const getNotice = (x: string, timeout?: number) => { // only show notices in manual mode // no notice in auto mode if (triggerSource === "manual" || triggerSource === "dry") { - new Notice(x); + new Notice(x, timeout); } }; if (this.syncStatus !== "idle") { @@ -331,8 +331,8 @@ export default class RemotelySavePlugin extends Plugin { }); log.info(msg); log.info(error); - getNotice(msg); - getNotice(error.message); + getNotice(msg, 10 * 1000); + getNotice(error.message, 10 * 1000); this.syncStatus = "idle"; if (this.syncRibbon !== undefined) { setIcon(this.syncRibbon, iconNameSyncWait);