fixes etc

This commit is contained in:
Vendicated
2026-04-05 04:07:23 +02:00
parent f3e01c2ba4
commit cf3667c151
12 changed files with 150 additions and 22 deletions
+7 -5
View File
@@ -12,7 +12,6 @@ import { Settings } from "./settings";
function unregisterKeyBinds() {
if (!app.isReady()) return;
globalShortcut.unregisterAll();
}
@@ -21,15 +20,18 @@ export async function registerKeyBinds() {
unregisterKeyBinds();
let success = true;
for (const { action, enabled, key } of Settings.store.keyBinds || []) {
if (!enabled || !key || action === "unassigned") continue;
console.log(
key,
"SUCCESS",
globalShortcut.register(key, () => sendRendererCommand(IpcCommands.HANDLE_KEY_BIND, action))
const registeredSuccessfully = globalShortcut.register(key, () =>
sendRendererCommand(IpcCommands.KEY_BINDS_HANDLE, action)
);
success &&= registeredSuccessfully;
}
sendRendererCommand(IpcCommands.KEY_BINDS_SET_STATUS, success);
}
Settings.addChangeListener("keyBinds", registerKeyBinds);