diff --git a/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx b/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx index 39035b2c3e6c6c..209c3d783256d1 100644 --- a/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx +++ b/components/dashboard/src/prebuilds/detail/PrebuildDetailPage.tsx @@ -67,10 +67,15 @@ export const PrebuildDetailPage: FC = () => { const triggeredString = useMemo(() => formatDate(triggeredDate), [triggeredDate]); useEffect(() => { - watchPrebuild(prebuildId, (prebuild) => { + setLogNotFound(false); + const disposable = watchPrebuild(prebuildId, (prebuild) => { setCurrentPrebuild(prebuild); }); - }, [prebuildId, setCurrentPrebuild]); + + return () => { + disposable.dispose(); + }; + }, [prebuildId]); useEffect(() => { logEmitter.on("error", (err: Error) => {