fix: try to correct notification indicator display issue
This commit is contained in:
@@ -151,9 +151,6 @@ export function NostrProvider({ children }: { children: React.ReactNode }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const storedNotificationsSeenAt = storage.getLastReadNotificationTime(account.pubkey)
|
const storedNotificationsSeenAt = storage.getLastReadNotificationTime(account.pubkey)
|
||||||
if (storedNotificationsSeenAt) {
|
|
||||||
setNotificationsSeenAt(storedNotificationsSeenAt)
|
|
||||||
}
|
|
||||||
|
|
||||||
const [
|
const [
|
||||||
storedRelayListEvent,
|
storedRelayListEvent,
|
||||||
@@ -258,13 +255,12 @@ export function NostrProvider({ children }: { children: React.ReactNode }) {
|
|||||||
await indexedDb.putReplaceableEvent(favoriteRelaysEvent)
|
await indexedDb.putReplaceableEvent(favoriteRelaysEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
const notificationsSeenAt = Math.max(
|
||||||
notificationsSeenAtEvent &&
|
notificationsSeenAtEvent?.created_at ?? 0,
|
||||||
notificationsSeenAtEvent.created_at > storedNotificationsSeenAt
|
storedNotificationsSeenAt
|
||||||
) {
|
)
|
||||||
setNotificationsSeenAt(notificationsSeenAtEvent.created_at)
|
setNotificationsSeenAt(notificationsSeenAt)
|
||||||
storage.setLastReadNotificationTime(account.pubkey, notificationsSeenAtEvent.created_at)
|
storage.setLastReadNotificationTime(account.pubkey, notificationsSeenAt)
|
||||||
}
|
|
||||||
|
|
||||||
client.initUserIndexFromFollowings(account.pubkey, controller.signal)
|
client.initUserIndexFromFollowings(account.pubkey, controller.signal)
|
||||||
return controller
|
return controller
|
||||||
|
|||||||
Reference in New Issue
Block a user