diff --git a/app/src/pages/RunSummary/index.tsx b/app/src/pages/RunSummary/index.tsx index 5e117b38bca..30975ef698d 100644 --- a/app/src/pages/RunSummary/index.tsx +++ b/app/src/pages/RunSummary/index.tsx @@ -80,7 +80,13 @@ export function RunSummary(): JSX.Element { const { t } = useTranslation('run_details') const navigate = useNavigate() const host = useHost() - const { data: runRecord } = useNotifyRunQuery(runId, { staleTime: Infinity }) + const { data: runRecord } = useNotifyRunQuery(runId, { + staleTime: Infinity, + onError: () => { + // in case the run is remotely deleted by a desktop app, navigate to the dash + navigate('/') + }, + }) const isRunCurrent = Boolean( useNotifyRunQuery(runId, { refetchInterval: CURRENT_RUN_POLL_MS })?.data ?.data?.current @@ -135,15 +141,6 @@ export function RunSummary(): JSX.Element { } }, [isRunCurrent, enteredER]) - React.useEffect(() => { - // in case the run is remotely deleted by a desktop app, navigate to the dash - console.log('run record == null: ', runRecord == null) - console.log('is quick transfer: ', isQuickTransfer) - if (runRecord == null && isQuickTransfer) { - navigate('/') - } - }, [runRecord, isQuickTransfer]) - const { reset, isResetRunLoading } = useRunControls(runId, onCloneRunSuccess) const trackEvent = useTrackEvent() const { closeCurrentRun, isClosingCurrentRun } = useCloseCurrentRun()