Skip to content

Commit 50d4bf0

Browse files
grimmerkclaude
andcommitted
fix: guard shortcut cleanup on tab re-click, show after bootstrap
- Skip shortcut resume when re-clicking active Shortcuts tab - Move showSwitcherWindow() to after bootstrap() + loadUserSettings() (was using setTimeout(100) which didn't guarantee readiness) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25e456b commit 50d4bf0

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,11 +1081,6 @@ const trayToggleEvtHandler = async () => {
10811081
}
10821082

10831083
switcherWindow = createSwitcherWindow();
1084-
// Normal mode: show window after bootstrap (server must be ready for API calls)
1085-
if (appMode === 'normal') {
1086-
// Delay show to ensure bootstrap() has completed (runs earlier in this block)
1087-
setTimeout(() => showSwitcherWindow(), 100);
1088-
}
10891084
if (isDebug) {
10901085
console.log('when ready');
10911086
}
@@ -1280,6 +1275,11 @@ const trayToggleEvtHandler = async () => {
12801275
// Load user settings
12811276
await loadUserSettings();
12821277

1278+
// Normal mode: show window after bootstrap + settings loaded (server ready for API calls)
1279+
if (appMode === 'normal') {
1280+
showSwitcherWindow();
1281+
}
1282+
12831283
let title = '';
12841284
if (!isDebug) {
12851285
title = ``;

src/popup.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ const PopupDefaultExample = ({
328328
<button
329329
key={tab}
330330
onClick={() => {
331+
if (tab === settingsTab) return;
331332
// Resume any paused shortcut when switching away from Shortcuts tab
332333
if (editingShortcut) {
333334
window.electronAPI.resumeShortcut(editingShortcut);

0 commit comments

Comments
 (0)