diff options
| author | Henry Jameson <me@hjkos.com> | 2023-11-21 15:29:49 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2023-11-21 15:29:49 +0200 |
| commit | 92685e37b61d27cfd964c000f45331535d97de39 (patch) | |
| tree | 3c90dab640956a29408b5cc40d23cd53785a021e /src/services/notifications_fetcher/notifications_fetcher.service.js | |
| parent | e36548579fb179d0431591529158a65f85e5b134 (diff) | |
fix infinity case
Diffstat (limited to 'src/services/notifications_fetcher/notifications_fetcher.service.js')
| -rw-r--r-- | src/services/notifications_fetcher/notifications_fetcher.service.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index 21540845..c91a86c8 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -52,9 +52,11 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => { const unreadNotifsIds = notifications.filter(n => !n.seen).map(n => n.id) if (readNotifsIds.length > 0 && readNotifsIds.length > 0) { const minId = Math.min(...unreadNotifsIds) // Oldest known unread notification - args.since = false // Don't use since_id since it sorta conflicts with min_id - args.minId = minId - 1 // go beyond - fetchNotifications({ store, args, older }) + if (minId !== Infinity) { + args.since = false // Don't use since_id since it sorta conflicts with min_id + args.minId = minId - 1 // go beyond + fetchNotifications({ store, args, older }) + } } return result |
