File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,16 @@ export type MainHeaderProps = {};
21
21
22
22
function Header ( props : MainHeaderProps ) {
23
23
const dispatch = useDispatch ( ) ;
24
- const { data : notificationCountData } = useQuery ( NOTIFICATION_COUNT ) ;
25
24
26
25
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
+
27
34
const [ userMenu , toggleUserMenu ] = useToggle ( false ) ;
28
35
const ref = useRef < HTMLDivElement > ( null ) ;
29
36
@@ -42,6 +49,7 @@ function Header(props: MainHeaderProps) {
42
49
dispatch ( showAuthModal ( 'LOGIN' ) ) ;
43
50
return ;
44
51
}
52
+ refetch ( ) ;
45
53
} ;
46
54
47
55
const notificationCount = notificationCountData ?. notificationCount ?? 0 ;
You can’t perform that action at this time.
0 commit comments