Skip to content

Commit

Permalink
fix(notifications): issue where notifications would not update #495
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Apr 21, 2022
1 parent d8180a5 commit f529734
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/sass/partials/topnav.sass
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
width: 100%
background: lighten($page_content_right_bg, 10%) !important
border-bottom: 1px solid rgba(0,0,0,0.2)
height: 72px
height: 62px
max-height: 80px
line-height: normal
&:hover
Expand All @@ -254,7 +254,7 @@
.item
display: block
width: 100%
height: 71px
height: 61px
padding: 10px !important
background: lighten($page_content_right_bg, 10%) !important
line-height: normal !important
Expand Down
12 changes: 7 additions & 5 deletions src/socketio/notificationSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
var _ = require('lodash')
var async = require('async')
var winston = require('winston')
var winston = require('../logger')
var utils = require('../helpers/utils')

var events = {}
Expand All @@ -30,9 +30,10 @@ function eventLoop () {
}

function updateNotifications () {
_.each(io.sockets.sockets, function (socket) {
var notifications = {}
var notificationSchema = require('../models/notification')
const notificationSchema = require('../models/notification')
// eslint-disable-next-line no-unused-vars
for (const [_, socket] of io.of('/').sockets) {
const notifications = {}
async.parallel(
[
function (done) {
Expand All @@ -48,6 +49,7 @@ function updateNotifications () {
if (err) return done(err)

notifications.count = count

return done()
})
}
Expand All @@ -61,7 +63,7 @@ function updateNotifications () {
utils.sendToSelf(socket, 'updateNotifications', notifications)
}
)
})
}
}

function updateAllNotifications (socket) {
Expand Down

0 comments on commit f529734

Please sign in to comment.