Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma-fe
Merge requests
!1198
Fix the notifications polling when all the latest notifications are unread
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix the notifications polling when all the latest notifications are unread
eugenijm/pleroma-fe:fix-notification-polling
into
develop
Overview
1
Commits
1
Pipelines
3
Changes
1
1 unresolved thread
Hide all comments
Merged
Eugenij
requested to merge
eugenijm/pleroma-fe:fix-notification-polling
into
develop
4 years ago
Overview
1
Commits
1
Pipelines
3
Changes
1
1 unresolved thread
Hide all comments
Expand
Closes
#896 (closed)
0
0
Merge request reports
Compare
version 2
version 2
e1ed6e49
4 years ago
version 1
4d0d6d9e
4 years ago
develop (base)
and
latest version
latest version
5b9d22e2
1 commit,
4 years ago
version 2
e1ed6e49
1 commit,
4 years ago
version 1
4d0d6d9e
1 commit,
4 years ago
Show latest version
1 file
+
2
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/services/notifications_fetcher/notifications_fetcher.service.js
+
2
−
5
Options
@@ -35,11 +35,8 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => {
const
notifications
=
timelineData
.
data
const
readNotifsIds
=
notifications
.
filter
(
n
=>
n
.
seen
).
map
(
n
=>
n
.
id
)
const
numUnseenNotifs
=
notifications
.
length
-
readNotifsIds
.
length
if
(
numUnseenNotifs
>
0
)
{
const
latestNotifications
=
readNotifsIds
.
length
===
0
?
notifications
:
readNotifsIds
if
(
latestNotifications
.
length
>
0
)
{
args
[
'
since
'
]
=
Math
.
max
(...
latestNotifications
)
}
if
(
numUnseenNotifs
>
0
&&
readNotifsIds
.
length
>
0
)
{
args
[
'
since
'
]
=
Math
.
max
(...
readNotifsIds
)
fetchNotifications
({
store
,
args
,
older
})
}
return
result
Loading