Skip to content

Commit

Permalink
Fix notification counts
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Dec 27, 2018
1 parent aa073c9 commit d212efb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 7 additions & 2 deletions http/js/iznik/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,9 @@ define([

var chatTitleCount = 0;
var newsfeedTitleCount = 0;
var workTitleCount = 0;

Iznik.setTitleCounts = function(chat, newsfeed) {
Iznik.setTitleCounts = function(chat, newsfeed, work) {
if (chat !== null) {
chatTitleCount = chat;
}
Expand All @@ -451,7 +452,11 @@ define([
newsfeedTitleCount = newsfeed;
}

var unseen = chatTitleCount + newsfeedTitleCount;
if (work !== null) {
workTitleCount = work;
}

var unseen = chatTitleCount + newsfeedTitleCount + workTitleCount;

// We'll adjust the count in the window title.
var title = document.title;
Expand Down
1 change: 1 addition & 0 deletions http/js/iznik/models/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ define([
})

document.title = (total == 0) ? 'ModTools' : ('(' + total + ') ModTools');
Iznik.setTitleCounts(null, null, total);

if (total) {
$('.js-workcount').html(total).show();
Expand Down
2 changes: 1 addition & 1 deletion http/js/iznik/views/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ define([
}
}

Iznik.setTitleCounts(titleunseen, null);
Iznik.setTitleCounts(titleunseen, null, null);
});

self.showMin();
Expand Down
4 changes: 2 additions & 2 deletions http/js/iznik/views/pages/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ define([
$('.js-notifholder .js-notifcount').css('visibility', 'hidden');
}

Iznik.setTitleCounts(null, ret.count);
Iznik.setTitleCounts(null, ret.count, null);
}

Iznik.setTitleCounts(null, ret.count);
Iznik.setTitleCounts(null, ret.count, null);
}
}, complete: function() {
// We have the unseen newsfeed count in the session. That is loosely up to date, which is
Expand Down

0 comments on commit d212efb

Please sign in to comment.