From 892c6904af301c0b3e200ed2723e6ed1efe0bdd8 Mon Sep 17 00:00:00 2001 From: Alexander Zaslonov Date: Sat, 21 Sep 2024 14:01:20 -0700 Subject: [PATCH] Added duration override for error notifications. --- src/ko/ui/defaultViewManager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ko/ui/defaultViewManager.ts b/src/ko/ui/defaultViewManager.ts index dc4331ca..0b95b041 100644 --- a/src/ko/ui/defaultViewManager.ts +++ b/src/ko/ui/defaultViewManager.ts @@ -240,7 +240,7 @@ export class DefaultViewManager implements ViewManager { public notifyError(title: string, content: string): Toast { const toast = new Toast(title, content, "error"); this.toasts.push(toast); - this.scheduleToastRemoval(toast); + this.scheduleToastRemoval(toast, 15000); return toast; } @@ -332,10 +332,10 @@ export class DefaultViewManager implements ViewManager { this.mode = ViewManagerMode.selecting; } - public scheduleToastRemoval(toast: Toast): void { + private scheduleToastRemoval(toast: Toast, displayDuration: number = 8000): void { setTimeout(() => { this.toasts(_.without(this.toasts(), toast)); - }, 8000); + }, displayDuration); } public openUploadDialog(...accept: string[]): Promise {