Skip to content

Commit

Permalink
Added duration override for error notifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
azaslonov committed Sep 21, 2024
1 parent 611bad7 commit 892c690
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ko/ui/defaultViewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<File[]> {
Expand Down

0 comments on commit 892c690

Please sign in to comment.