Tried to fix macos shortcuts

This commit is contained in:
mauro-balades 2024-10-06 14:03:17 +02:00
parent e8eb4a41cf
commit 2d62e7d9be
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -378,9 +378,15 @@ class KeyShortcut {
key.setAttribute('command', this.#action); key.setAttribute('command', this.#action);
} }
} }
key.setAttribute('disabled', this.#disabled); if (this.#disabled) {
key.setAttribute('reserved', this.#reserved); key.setAttribute('disabled', this.#disabled);
key.setAttribute('internal', this.#internal); }
if (this.#reserved) {
key.setAttribute('reserved', this.#reserved);
}
if (this.#internal) {
key.setAttribute('internal', this.#internal);
}
key.setAttribute('zen-keybind', 'true'); key.setAttribute('zen-keybind', 'true');
return key; return key;
@ -731,7 +737,9 @@ class ZenKeyboardShortcutsVersioner {
return newData; return newData;
} }
throw new Error('Unknown keyboar shortcuts version'); console.error('Unknown keyboar shortcuts version');
this.version = 0;
return this.migrateIfNeeded(data);
} }
migrate(data, version) { migrate(data, version) {
@ -888,3 +896,7 @@ var gZenKeyboardShortcutsManager = {
return false; return false;
}, },
}; };
window.addEventListener("MozBeforeInitialXULLayout", async () => {
await gZenKeyboardShortcutsManager.init();
});