diff --git a/src/ui/components/DevTools.tsx b/src/ui/components/DevTools.tsx index e4f0d0d0df1..67d59179b7d 100644 --- a/src/ui/components/DevTools.tsx +++ b/src/ui/components/DevTools.tsx @@ -284,7 +284,7 @@ function _DevTools({ }; if (unsupportedTarget) { - return ; + return ; } if (!loadingFinished) { diff --git a/src/ui/components/UnsupportedTarget.tsx b/src/ui/components/UnsupportedTarget.tsx index 66add9d4b34..24e74123321 100644 --- a/src/ui/components/UnsupportedTarget.tsx +++ b/src/ui/components/UnsupportedTarget.tsx @@ -1,18 +1,33 @@ -export function UnsupportedTarget({ target }: { target: string }) { +import { useEffect, useState } from "react"; + +export function UnsupportedTarget() { const url = new URL(window.location.href); - url.pathname + url.search; + const redirectUrl = `https://legacy.replay.io${url.pathname + url.search}`; + + const [count, setCount] = useState(5); + + useEffect(() => { + if (count <= 0) { + window.location.href = redirectUrl; + } else { + const timeout = setTimeout(() => { + setCount(count - 1); + }, 1000); + + return () => { + clearTimeout(timeout); + }; + } + }, [count, redirectUrl]); return (
- Recordings made with {target} must be viewed at{" "} - + Redirecting to{" "} + legacy.replay.io - - . + {" "} + in {count}...
);