File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,26 @@ import media from '../../lib/styles/media';
12
12
import HeaderLogo from './HeaderLogo' ;
13
13
import { themedPalette } from '../../lib/styles/themes' ;
14
14
import VLink from '../common/VLink' ;
15
- import { useDispatch } from 'react-redux' ;
15
+ import { useDispatch , useSelector } from 'react-redux' ;
16
16
import { showAuthModal } from '../../modules/core' ;
17
17
import { useQuery } from '@apollo/react-hooks' ;
18
18
import { NOTIFICATION_COUNT } from '../../lib/graphql/notification' ;
19
+ import { RootState } from '../../modules' ;
19
20
20
21
export type MainHeaderProps = { } ;
21
22
22
23
function Header ( props : MainHeaderProps ) {
23
24
const dispatch = useDispatch ( ) ;
24
- const { data : notificationCountData , refetch } = useQuery ( NOTIFICATION_COUNT ) ;
25
25
26
26
const { user, onLoginClick, onLogout, customHeader } = useHeader ( ) ;
27
+ const { data : notificationCountData , refetch } = useQuery (
28
+ NOTIFICATION_COUNT ,
29
+ {
30
+ fetchPolicy : 'network-only' ,
31
+ skip : ! user ,
32
+ } ,
33
+ ) ;
34
+
27
35
const [ userMenu , toggleUserMenu ] = useToggle ( false ) ;
28
36
const ref = useRef < HTMLDivElement > ( null ) ;
29
37
You can’t perform that action at this time.
0 commit comments