mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-03-14 11:52:33 +00:00
fix qmail notification
This commit is contained in:
parent
1894fb7756
commit
2f7f6a4bad
@ -103,16 +103,16 @@ export const QMailMessages = ({userName, userAddress}) => {
|
||||
|
||||
}, [getMails, userName, userAddress]);
|
||||
|
||||
const anyUnread = useMemo(()=> {
|
||||
let unread = false
|
||||
|
||||
mails.forEach((mail)=> {
|
||||
if(lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created)){
|
||||
unread = true
|
||||
}
|
||||
})
|
||||
return unread
|
||||
}, [mails, lastEnteredTimestamp])
|
||||
const anyUnread = useMemo(()=> {
|
||||
let unread = false
|
||||
|
||||
mails.forEach((mail)=> {
|
||||
if(!lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created) || (lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created) && lastEnteredTimestamp < mail?.created)){
|
||||
unread = true
|
||||
}
|
||||
})
|
||||
return unread
|
||||
}, [mails, lastEnteredTimestamp])
|
||||
|
||||
return (
|
||||
<Box
|
||||
@ -143,13 +143,13 @@ export const QMailMessages = ({userName, userAddress}) => {
|
||||
Latest Q-Mails
|
||||
</Typography>
|
||||
<MarkEmailUnreadIcon sx={{
|
||||
color: anyUnread ? '--unread' : 'white'
|
||||
color: anyUnread ? 'var(--unread)' : 'white'
|
||||
}}/>
|
||||
{isExpanded ? <ExpandLessIcon sx={{
|
||||
marginLeft: 'auto'
|
||||
}} /> : (
|
||||
<ExpandMoreIcon sx={{
|
||||
color: anyUnread ? '--unread' : 'white',
|
||||
color: anyUnread ? 'var(--unread)' : 'white',
|
||||
marginLeft: 'auto'
|
||||
}} />
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user