fix(ui): close detail modal when removing downloads

Confirming removal from the game detail modal used to clear only the
confirmation modal state. The detail modal remained open for the same game while
the removal operation was in flight, which could show stale removing or
post-removal state around the closed confirmation dialog.

Close the detail modal when it is showing the game whose downloaded copy is being
removed. Other open detail state is left alone so the change stays scoped to the
confirmed removal flow.

Test Plan:
- deno task build
- RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= just build
- git diff --check

Refs: local review feedback
This commit is contained in:
2026-05-19 21:28:23 +02:00
parent 62ceb063ac
commit 59efe9e2d7
@@ -97,6 +97,7 @@ export const MainWindow = () => {
const confirmRemoveDownload = useCallback((game: Game) => { const confirmRemoveDownload = useCallback((game: Game) => {
actions.removeDownload(game.id); actions.removeDownload(game.id);
setRemoveGameId(null); setRemoveGameId(null);
setOpenGameId(current => current === game.id ? null : current);
}, [actions]); }, [actions]);
const kebabItems: ReadonlyArray<KebabItem> = useMemo(() => [ const kebabItems: ReadonlyArray<KebabItem> = useMemo(() => [