diff --git a/src/components/app/details/triggerView/cdMaterial.tsx b/src/components/app/details/triggerView/cdMaterial.tsx index c593c15d48..25d54da190 100644 --- a/src/components/app/details/triggerView/cdMaterial.tsx +++ b/src/components/app/details/triggerView/cdMaterial.tsx @@ -337,7 +337,9 @@ const CDMaterial = ({ abortDeployRef.current = new AbortController() return () => { abortDeployRef.current.abort() - history.replace(pathname.split(URLS.APP_DIFF_VIEW)[0]) + if (history.location.pathname.includes(URLS.APP_DIFF_VIEW)) { + history.replace(history.location.pathname.split(URLS.APP_DIFF_VIEW)[0]) + } } }, [])