Skip to content

Commit

Permalink
[dashboard] Apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jankeromnes authored and svenefftinge committed Mar 15, 2021
1 parent cfc3af8 commit eda11c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ function App() {
window.location.reload(true);
}
}, false);
const hash = window.location.hash.replace(/^[#/]+/, '');

const hash = getURLHash();
if (window.location.pathname === '/' && hash !== '') {
return <CreateWorkspace contextUrl={hash} gitpodService={gitpodService}/>;
}
if (/\/start\/?/.test(window.location.pathname)) {
if (/\/start\/?/.test(window.location.pathname) && hash !== '') {
return <StartWorkspace workspaceId={hash} gitpodService={gitpodService}/>;
}

Expand Down Expand Up @@ -85,6 +86,10 @@ function App() {
);
}

function getURLHash () {
return window.location.hash.replace(/^[#/]+/, '');
}

const renderMenu = () => (
<Menu left={[
{
Expand Down

0 comments on commit eda11c2

Please sign in to comment.