提交 6855db21 编写于 作者: B Benjamin Pasero

fix #45026

上级 edba4536
......@@ -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 */);
......
......@@ -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({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册