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:
@@ -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(() => [
|
||||||
|
|||||||
Reference in New Issue
Block a user