diff --git a/components/dashboard/src/App.tsx b/components/dashboard/src/App.tsx index 52baf822ec0bd8..7a36467974aaa4 100644 --- a/components/dashboard/src/App.tsx +++ b/components/dashboard/src/App.tsx @@ -41,6 +41,10 @@ function Loading() { ; } +function isGitpodIo() { + return window.location.hostname === 'gitpod.io' || window.location.hostname === 'gitpod-staging.com' || window.location.hostname.endsWith('gitpod-dev.com') +} + function App() { const { user, setUser } = useContext(UserContext); @@ -90,8 +94,7 @@ function App() { } }, []); - if ((window.location.hostname === 'gitpod.io' || window.location.hostname === 'gitpod-staging.com' || window.location.hostname.endsWith('gitpod-dev.com')) - && window.location.pathname === '/' && window.location.hash === '' && !loading && !user) { + if (isGitpodIo() && window.location.pathname === '/' && window.location.hash === '' && !loading && !user) { window.location.href = `https://www.gitpod.io`; return
; } @@ -174,11 +177,18 @@ function App() {

{decodeURIComponent(getURLHash())}

- -
-

404

-

Page not found.

-
+ { + + return isGitpodIo() ? + // delegate to our website to handle the request + (window.location.host = 'www.gitpod.io') : +
+

404

+

Page not found.

+
; + } + }>