chore: prevent shortcuts from invoking recording when in shortcut recording state

This commit is contained in:
haritabh-z01 2025-07-06 14:49:55 +05:30
parent fd7f4bff49
commit 3f8ea518f6
5 changed files with 60 additions and 2 deletions

View file

@ -136,6 +136,35 @@ export const settingsRouter = t.router({
}
}),
// Set shortcut recording state
setShortcutRecordingState: t.procedure
.input(z.boolean())
.mutation(async ({ input }) => {
try {
if (!globalThis.shortcutManager) {
throw new Error("ShortcutManager not available");
}
globalThis.shortcutManager.setIsRecordingShortcut(input);
if (globalThis.logger) {
globalThis.logger.main.info("Shortcut recording state updated", {
isRecording: input,
});
}
return true;
} catch (error) {
if (globalThis.logger) {
globalThis.logger.main.error(
"Error setting shortcut recording state:",
error,
);
}
throw error;
}
}),
// Active keys subscription for shortcut recording
activeKeysUpdates: t.procedure.subscription(() => {
return observable<string[]>((emit) => {