This commit is contained in:
Benjamin Pasero 2018-03-05 07:33:20 +01:00
parent edba453692
commit 6855db2160
2 changed files with 14 additions and 2 deletions

View file

@ -71,6 +71,10 @@ export class NotificationsCenter extends Themable {
}
public show(): void {
if (this.model.notifications.length === 0) {
return; // currently not supporting to show empty (https://github.com/Microsoft/vscode/issues/44509)
}
if (this._isVisible) {
this.notificationsList.show(true /* focus */);

View file

@ -81,7 +81,9 @@ export function registerNotificationCommands(center: INotificationsCenterControl
}
// Show Notifications Cneter
CommandsRegistry.registerCommand(SHOW_NOTIFICATIONS_CENTER, () => center.show());
CommandsRegistry.registerCommand(SHOW_NOTIFICATIONS_CENTER, () => {
center.show();
});
// Hide Notifications Center
KeybindingsRegistry.registerCommandAndKeybindingRule({
@ -93,7 +95,13 @@ export function registerNotificationCommands(center: INotificationsCenterControl
});
// Toggle Notifications Center
CommandsRegistry.registerCommand(TOGGLE_NOTIFICATIONS_CENTER, accessor => center.isVisible ? center.hide() : center.show());
CommandsRegistry.registerCommand(TOGGLE_NOTIFICATIONS_CENTER, accessor => {
if (center.isVisible) {
center.hide();
} else {
center.show();
}
});
// Clear Notification
KeybindingsRegistry.registerCommandAndKeybindingRule({