From 129c3ed2171f7b0114e15418af040420467b58ce Mon Sep 17 00:00:00 2001 From: Kenta Kishikawa Date: Mon, 4 Dec 2023 14:17:46 +0000 Subject: [PATCH] fix(web): file menu save and save as not working --- packages/web/src/utility/contextMenu.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/web/src/utility/contextMenu.ts b/packages/web/src/utility/contextMenu.ts index 5705bdf6..46365f2e 100644 --- a/packages/web/src/utility/contextMenu.ts +++ b/packages/web/src/utility/contextMenu.ts @@ -1,6 +1,7 @@ import _ from 'lodash'; import { getContext, setContext } from 'svelte'; import invalidateCommands from '../commands/invalidateCommands'; +import { runGroupCommand } from '../commands/runCommand'; import { currentDropDownMenu, visibleCommandPalette } from '../stores'; import getAsArray from './getAsArray'; @@ -98,8 +99,12 @@ function mapItem(item, commands) { text: item.text || command.menuName || command.toolbarName || command.name, keyText: command.keyText || command.keyTextFromGroup, onClick: () => { - if (command.getSubCommands) visibleCommandPalette.set(command); - else if (command.onClick) command.onClick(); + if (command.isGroupCommand) { + runGroupCommand(command.group); + } else { + if (command.getSubCommands) visibleCommandPalette.set(command); + else if (command.onClick) command.onClick(); + } }, disabled: !command.enabled, hideDisabled: item.hideDisabled,