Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions platform/core/src/classes/HotkeysManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,8 @@ export class HotkeysManager {
* @param hotkey - The hotkey definition object.
* @throws {Error} Throws an error if no commandName is provided.
*/
registerHotkeys({
commandName,
commandOptions = {},
context,
keys,
label,
isEditable,
}: Hotkey): void {
registerHotkeys(hotkeyDefinition: Hotkey): void {
const { commandName, commandOptions = {}, context, keys } = hotkeyDefinition;
if (!commandName) {
throw new Error(`No command was defined for hotkey "${keys}"`);
}
Expand All @@ -256,7 +250,7 @@ export class HotkeysManager {
this._unbindHotkeys(commandName, existingHotkey.keys);
}

this.hotkeyDefinitions[commandHash] = { commandName, commandOptions, keys, label, isEditable };
this.hotkeyDefinitions[commandHash] = { ...hotkeyDefinition };
this._bindHotkeys(commandName, commandOptions, context, keys);
}

Expand Down