Skip to content

Commit 914e987

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/turnstile
2 parents f34ec20 + 208468d commit 914e987

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/base/Header.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ export type MainHeaderProps = {};
2121

2222
function Header(props: MainHeaderProps) {
2323
const dispatch = useDispatch();
24-
const { data: notificationCountData } = useQuery(NOTIFICATION_COUNT);
2524

2625
const { user, onLoginClick, onLogout, customHeader } = useHeader();
26+
const { data: notificationCountData, refetch } = useQuery(
27+
NOTIFICATION_COUNT,
28+
{
29+
fetchPolicy: 'network-only',
30+
skip: !user,
31+
},
32+
);
33+
2734
const [userMenu, toggleUserMenu] = useToggle(false);
2835
const ref = useRef<HTMLDivElement>(null);
2936

@@ -42,6 +49,7 @@ function Header(props: MainHeaderProps) {
4249
dispatch(showAuthModal('LOGIN'));
4350
return;
4451
}
52+
refetch();
4553
};
4654

4755
const notificationCount = notificationCountData?.notificationCount ?? 0;

0 commit comments

Comments
 (0)