Skip to content

Commit 2799d01

Browse files
committed
fix: refetch notification count when icon click
1 parent d3d05c6 commit 2799d01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/base/Header.tsx

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

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

2626
const { user, onLoginClick, onLogout, customHeader } = useHeader();
2727
const [userMenu, toggleUserMenu] = useToggle(false);
@@ -42,6 +42,7 @@ function Header(props: MainHeaderProps) {
4242
dispatch(showAuthModal('LOGIN'));
4343
return;
4444
}
45+
refetch();
4546
};
4647

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

0 commit comments

Comments
 (0)