fix(web): file menu save and save as not working

This commit is contained in:
Kenta Kishikawa 2023-12-04 14:17:46 +00:00
parent 79d1b7893d
commit 129c3ed217

View File

@ -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,