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