Skip to content

Commit 4bb0b33

Browse files
shobhit99claude
andcommitted
fix(launcher): guard setSettingsLoaded in catch on unmount
The catch branch of the initial settings-load effect was calling setSettingsLoaded(true) without checking the disposed flag, which would trigger React's setState-on-unmounted-component warning if the IPC rejected after the hook unmounted (hot-reload, fast navigation). Mirrors the existing guard in the .then branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0da3f64 commit 4bb0b33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/renderer/src/hooks/useBrowserSearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export function useBrowserSearch(_currentQuery: string): UseBrowserSearchResult
183183
setSettingsLoaded(true);
184184
})
185185
.catch(() => {
186-
setSettingsLoaded(true);
186+
if (!disposed) setSettingsLoaded(true);
187187
});
188188
return () => {
189189
disposed = true;

0 commit comments

Comments
 (0)