fix: 按键报错

This commit is contained in:
unanmed 2024-11-03 13:37:12 +08:00
parent fdab424f8b
commit 3a54ed6535

View File

@ -200,6 +200,7 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
set(id: string, key: KeyCode, assist: number, emit: boolean = true) {
const { ctrl, shift, alt } = unwarpBinary(assist);
const data = this.data[id];
if (!data) return;
const before = this.keyMap.get(data?.key ?? KeyCode.Unknown)! ?? [];
deleteWith(before, data);
this.ensureMap(key);