Set native app badge for highlights

This commit is contained in:
Pavel Djundik 2020-04-22 14:16:39 +03:00
parent 0642ae58ce
commit beb9fbd940

View file

@ -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();
}
}
}
);