Fix: fix notification icon blinking
This commit is contained in:
parent
e723791916
commit
f752bad447
3 changed files with 31 additions and 19 deletions
|
|
@ -68,6 +68,7 @@ const Header = memo(({ tree }) => {
|
|||
|
||||
const { data, refetch } = useQuery(HAS_UNREAD, { pollInterval: 60000 })
|
||||
const notifCenterButtonRef = useRef()
|
||||
const popperRef = useRef()
|
||||
const history = useHistory()
|
||||
const classes = useStyles()
|
||||
|
||||
|
|
@ -155,6 +156,7 @@ const Header = memo(({ tree }) => {
|
|||
{hasUnread && <div className={classes.hasUnread} />}
|
||||
</button>
|
||||
<Popper
|
||||
ref={popperRef}
|
||||
id={id}
|
||||
open={popperOpen}
|
||||
anchorEl={anchorEl}
|
||||
|
|
@ -167,10 +169,13 @@ const Header = memo(({ tree }) => {
|
|||
}
|
||||
}}>
|
||||
<NotificationCenter
|
||||
close={onClickAway}
|
||||
notifyUnread={refetch}
|
||||
hasUnread={hasUnread}
|
||||
popperRef={popperRef}
|
||||
notifButtonCoords={notifButtonCoords}
|
||||
close={onClickAway}
|
||||
refetchHasUnreadHeader={refetch}
|
||||
setHeaderHasUnread={unread => {
|
||||
setHasUnread(unread)
|
||||
}}
|
||||
/>
|
||||
</Popper>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue