White page on refresh
WebDev-Akhil opened this issue · comments
Workspace on refreshing the page shows a blank white page even when the user is logged in. (and shows a blank black page when tried in incognito mode)
Expected behaviour: should show the workspace contents upon validating the session. Should return a 404 page if the session is not found (eg: incognito mode or user not logged in).
Replicate the behaviour: goto locahost:3000/account/someworkspace
and refresh your page in the browser
This is in relation to: #20
We'll wait for the RFC so that we can improve our layout and app routing. In the meantime, if you have suggestions, we can work it together. Thanks! :D
I don't think this PR fixed #28.
The workspace dashboard stills returns white page (eg. http://localhost:3000/account/test1
)
I think this is because of useWorkspace() not loading when the user reloads the page.
In src/pages/account/[workspaceSlug]/index.js
, if you replace the current return with something static (example code below) then it will work but if you want to consume useWorkspace() it doesn't work
the below works on reload (as it is static)
return (
<AccountLayout>
<Meta title={`Nextacular - some hardcoded name | Dashboard`} />
<Content.Title
title="some hardcoded name"
subtitle="This is your project's workspace"
/>
<Content.Divider />
<Content.Container />
</AccountLayout>
);
the below doesn't works (as it consumes useWorkspace() and, on page reload it is not being fetched)
return (
workspace && (
<AccountLayout>
<Meta title={`Nextacular - ${workspace.name} | Dashboard`} />
<Content.Title
title={workspace.name}
subtitle="This is your project's workspace"
/>
<Content.Divider />
<Content.Container />
</AccountLayout>
)
);
Correct me if I'm wrong