Fix: fix notification icon blinking

This commit is contained in:
csrapr 2021-02-17 17:20:00 +00:00 committed by Josh Harvey
parent e723791916
commit f752bad447
3 changed files with 31 additions and 19 deletions

View file

@ -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>