From 8de82ed81f52b00b537788edc1dd134fede986a9 Mon Sep 17 00:00:00 2001 From: Anso Date: Thu, 9 Apr 2026 13:10:50 -0400 Subject: [PATCH] fix(fleet): prevent modal flash when clicking Recheck button (#457) Use a separate recheckingUpdates state for the Recheck button so the modal content stays visible while refreshing. The full-screen loading spinner (checkingUpdates) is now only used for the initial "Check Updates" open from the header. --- frontend/src/components/FleetView.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/FleetView.tsx b/frontend/src/components/FleetView.tsx index 3d1f031b..ad407a80 100644 --- a/frontend/src/components/FleetView.tsx +++ b/frontend/src/components/FleetView.tsx @@ -640,6 +640,7 @@ export function FleetView({ onNavigateToNode }: FleetViewProps) { const [localUpdateConfirm, setLocalUpdateConfirm] = useState(null); const [showUpdateModal, setShowUpdateModal] = useState(false); const [checkingUpdates, setCheckingUpdates] = useState(false); + const [recheckingUpdates, setRecheckingUpdates] = useState(false); const [modalSearch, setModalSearch] = useState(''); const updateStatusesRef = useRef(updateStatuses); updateStatusesRef.current = updateStatuses; @@ -1352,15 +1353,15 @@ export function FleetView({ onNavigateToNode }: FleetViewProps) { variant="ghost" size="sm" className="h-7 text-xs text-muted-foreground" - disabled={checkingUpdates} + disabled={recheckingUpdates} onClick={async () => { - setCheckingUpdates(true); + setRecheckingUpdates(true); await apiFetch('/fleet/update-status?recheck=true', { method: 'DELETE', localOnly: true }); await fetchUpdateStatus(); - setCheckingUpdates(false); + setRecheckingUpdates(false); }} > - + Recheck {updatableRemoteCount > 0 && (