From 3053b004e064d7a1b00f93e6467bf5bb6242af1b Mon Sep 17 00:00:00 2001 From: jeffvli Date: Fri, 7 Aug 2026 21:23:58 -0700 Subject: [PATCH] fix race condition of modal closure after queue clear confirmation - if the setting confirmQueueChanges: true, the shuffle all modal queue mutation handler would call closeAllModals after the queue add, which ended up closing the additional confirmation modal --- .../features/player/components/shuffle-all-modal.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/features/player/components/shuffle-all-modal.tsx b/src/renderer/features/player/components/shuffle-all-modal.tsx index ae17c8507..eded98767 100644 --- a/src/renderer/features/player/components/shuffle-all-modal.tsx +++ b/src/renderer/features/player/components/shuffle-all-modal.tsx @@ -149,6 +149,8 @@ export const ShuffleAllContextModal = () => { if (playbackKind === 'albums') { const { data } = await refetchAlbums(); + closeAllModals(); + addToQueueByFetch( server.id, data?.items.map((a) => a.id) ?? [], @@ -158,10 +160,10 @@ export const ShuffleAllContextModal = () => { } else { const { data } = await refetchSongs(); + closeAllModals(); + addToQueueByData(data?.items || [], playType); } - - closeAllModals(); }; return (