Merge pull request #197581 from microsoft/merogge/simple-bug

allow taking notification action on first / default
This commit is contained in:
Megan Rogge 2023-11-06 11:17:28 -08:00 committed by GitHub
commit 9527021b45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,11 +164,11 @@ export function registerNotificationCommands(center: INotificationsCenterControl
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: ACCEPT_PRIMARY_ACTION_NOTIFICATION,
weight: KeybindingWeight.WorkbenchContrib,
when: ContextKeyExpr.and(NotificationFocusedContext),
when: ContextKeyExpr.or(NotificationFocusedContext, NotificationsToastsVisibleContext),
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyA,
handler: (accessor) => {
const actionRunner = accessor.get(IInstantiationService).createInstance(NotificationActionRunner);
const notification = getNotificationFromContext(accessor.get(IListService));
const notification = getNotificationFromContext(accessor.get(IListService)) || firstOrDefault(model.notifications);
if (!notification) {
return;
}