Skip to content

Commit eda11c2

Browse files
jankeromnessvenefftinge
authored andcommitted
[dashboard] Apply code review suggestions
1 parent cfc3af8 commit eda11c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/dashboard/src/App.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ function App() {
4848
window.location.reload(true);
4949
}
5050
}, false);
51-
const hash = window.location.hash.replace(/^[#/]+/, '');
51+
52+
const hash = getURLHash();
5253
if (window.location.pathname === '/' && hash !== '') {
5354
return <CreateWorkspace contextUrl={hash} gitpodService={gitpodService}/>;
5455
}
55-
if (/\/start\/?/.test(window.location.pathname)) {
56+
if (/\/start\/?/.test(window.location.pathname) && hash !== '') {
5657
return <StartWorkspace workspaceId={hash} gitpodService={gitpodService}/>;
5758
}
5859

@@ -85,6 +86,10 @@ function App() {
8586
);
8687
}
8788

89+
function getURLHash () {
90+
return window.location.hash.replace(/^[#/]+/, '');
91+
}
92+
8893
const renderMenu = () => (
8994
<Menu left={[
9095
{

0 commit comments

Comments
 (0)