From bd43cb60f6058f95d176e5577a9c0a1129cfffe0 Mon Sep 17 00:00:00 2001 From: Nazar Kanaev Date: Wed, 19 Aug 2020 16:51:27 +0100 Subject: [PATCH] fix unread count in browser title --- assets/javascripts/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 0d7ed9c..ddbb0ca 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -240,8 +240,11 @@ var vm = new Vue({ deep: true, handler: debounce(function() { var title = TITLE - if (this.totalStats.unread) { - title += ' ('+this.totalStats.unread+')' + var unreadCount = Object.values(this.feedStats).reduce(function(acc, stat) { + return acc + stat.unread + }, 0) + if (unreadCount) { + title += ' ('+unreadCount+')' } document.title = title }, 500),