Improve notification load behaviors (#1943)
* Dont use the stale cache for notifs-feed * Add a delay to marking all read to avoid marking upcoming posts as read * Trigger automatic notifications refresh when navigating to the tab, in certain conditions
This commit is contained in:
parent
357c752a21
commit
e358c3cc30
5 changed files with 34 additions and 6 deletions
|
@ -54,9 +54,12 @@ export function Feed({
|
|||
|
||||
// mark all read on fresh data
|
||||
React.useEffect(() => {
|
||||
let cleanup
|
||||
if (firstItem) {
|
||||
markAllRead()
|
||||
const to = setTimeout(() => markAllRead(), 250)
|
||||
cleanup = () => clearTimeout(to)
|
||||
}
|
||||
return cleanup
|
||||
}, [firstItem, markAllRead])
|
||||
|
||||
const items = React.useMemo(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue