Skip to content

Commit 208468d

Browse files
authored
Merge pull request #503 from velopert/fix/notification-query
fix: notification count query in header
2 parents fdfedb4 + 3f58e27 commit 208468d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/base/Header.tsx

Lines changed: 8 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, refetch } = 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

0 commit comments

Comments
 (0)