feat(route): better refresh

This commit is contained in:
tzhangchi 2022-09-08 15:51:05 +08:00
parent aaca0798e3
commit 5b7e1a06ba
2 changed files with 0 additions and 6 deletions

View File

@ -9,7 +9,6 @@ import Pages from './pages';
export function WorkspaceContainer() {
const { workspace_id } = useParams();
const { user, currentSpaceId } = useUserAndSpaces();
if (
user &&
![currentSpaceId, 'affine2vin277tcmafwq'].includes(workspace_id)

View File

@ -5,7 +5,6 @@ import {
} from 'firebase/auth';
import { atom, useAtom } from 'jotai';
import { useEffect, useMemo } from 'react';
import { useLocation, useNavigate } from 'react-router';
import { useIdentifyUser } from '@toeverything/datasource/feature-flags';
import { UserInfo } from '@toeverything/utils';
@ -63,15 +62,11 @@ const BRAND_ID = 'AFFiNE';
const _localTrigger = atom<boolean>(false);
const _useUserAndSpacesForFreeLogin = () => {
const location = useLocation();
const navigate = useNavigate();
const [user, setUser] = useAtom(_userAtom);
const [loading, setLoading] = useAtom(_loadingAtom);
const [localTrigger] = useAtom(_localTrigger);
useEffect(() => {
if (loading) {
navigate(`/${BRAND_ID}`);
setLoading(false);
}
}, []);