mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 18:42:58 +03:00
fix(core): rerender (#4988)
This commit is contained in:
parent
c127d449a1
commit
899e46b1fa
@ -2,7 +2,7 @@ import { type User } from '@affine/component/auth-components';
|
||||
import type { DefaultSession, Session } from 'next-auth';
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
import { getSession, useSession } from 'next-auth/react';
|
||||
import { useEffect, useReducer } from 'react';
|
||||
import { useEffect, useMemo, useReducer } from 'react';
|
||||
|
||||
import { SessionFetchErrorRightAfterLoginOrSignUp } from '../../unexpected-application-state/errors';
|
||||
|
||||
@ -97,6 +97,7 @@ export function useCurrentUser(): CheckedUser {
|
||||
|
||||
const user = session.user;
|
||||
|
||||
return useMemo(() => {
|
||||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
@ -105,4 +106,5 @@ export function useCurrentUser(): CheckedUser {
|
||||
hasPassword: user?.hasPassword ?? false,
|
||||
update,
|
||||
};
|
||||
}, [user, update]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user