fix: page id could be invalid (#3204)

This commit is contained in:
Alex Yang 2023-07-13 12:18:18 +08:00 committed by GitHub
parent 5dda7d83da
commit 6a2dbc0105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,7 +239,9 @@ rootCurrentWorkspaceIdAtom.onMount = set => {
if (environment.isBrowser) {
const callback = (url: string) => {
const value = url.split('/')[2];
if (value) {
if (value === 'all' || value === 'trash' || value === 'shared') {
set(null);
} else if (value) {
set(value);
localStorage.setItem('last_workspace_id', value);
} else {