Skip to content

Commit

Permalink
set filters right on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Jun 27, 2022
1 parent 1bca7ce commit 359ee4c
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class NotificationService extends Disposable implements INotificationServ
) {
super();

this.updateDoNotDisturbFilters();
this.registerListeners();
}

Expand Down Expand Up @@ -80,16 +81,21 @@ export class NotificationService extends Disposable implements INotificationServ
this._doNotDisturbMode = enabled;

// Toggle via filter
this.updateDoNotDisturbFilters();

// Events
this._onDidChangeDoNotDisturbMode.fire();
}

private updateDoNotDisturbFilters(): void {
let filter: NotificationsFilter;
if (enabled) {
if (this._doNotDisturbMode) {
filter = NotificationsFilter.ERROR;
} else {
filter = NotificationsFilter.OFF;
}
this.model.setFilter(filter);

// Events
this._onDidChangeDoNotDisturbMode.fire();
this.model.setFilter(filter);
}

//#endregion
Expand Down

0 comments on commit 359ee4c

Please sign in to comment.