From beb9fbd940c0c65e5a494ccd654411a424860c0b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 22 Apr 2020 14:16:39 +0300 Subject: [PATCH] Set native app badge for highlights --- client/js/vue.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/js/vue.js b/client/js/vue.js index 3467b3c4..3b55727d 100644 --- a/client/js/vue.js +++ b/client/js/vue.js @@ -100,6 +100,14 @@ store.watch( (_, getters) => getters.highlightCount, (highlightCount) => { favicon.setAttribute("href", highlightCount > 0 ? faviconAlerted : faviconNormal); + + if (navigator.setAppBadge) { + if (highlightCount > 0) { + navigator.setAppBadge(highlightCount); + } else { + navigator.clearAppBadge(); + } + } } );