update(Auth): 实时监听 userInfo.id 变化

feature/artists
mackt 6 months ago
parent 964bbb4b5f
commit f2379deea6

@ -10,15 +10,11 @@ import { LoginModal } from '@/components';
import { useUserStore } from '@/store'; import { useUserStore } from '@/store';
export default function Auth() { export default function Auth() {
const { userInfo } = useUserStore( const userId = useUserStore(useShallow((state) => state.userInfo.id));
useShallow((state) => ({
userInfo: state.userInfo,
})),
);
return ( return (
<div> <div>
{!!userInfo.id ? ( {!!userId ? (
<HeaderAvatar className="ml-[40px]" /> <HeaderAvatar className="ml-[40px]" />
) : ( ) : (
<LoginProvider> <LoginProvider>

Loading…
Cancel
Save