mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 08:12:25 +03:00
feat(route): better refresh
This commit is contained in:
parent
aaca0798e3
commit
5b7e1a06ba
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
}, []);
|
||||
|
Loading…
Reference in New Issue
Block a user