From 8c74d0c7c88e2f1a81de06da6d3330c1bdd8eefa Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 27 May 2019 14:25:45 -0700 Subject: [PATCH] fix: add push notification badge (#1246) --- src/service-worker.js | 4 ++++ static/icon-push-badge.png | Bin 0 -> 2144 bytes 2 files changed, 4 insertions(+) create mode 100644 static/icon-push-badge.png diff --git a/src/service-worker.js b/src/service-worker.js index 31c27c7d..d2b44488 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -134,10 +134,12 @@ async function showRichNotification (data, notification) { const { icon, body } = data const tag = notification.id const { origin } = self.location + const badge = '/icon-push-badge.png' switch (notification.type) { case 'follow': { await self.registration.showNotification(data.title, { + badge, icon, body, tag, @@ -151,6 +153,7 @@ async function showRichNotification (data, notification) { case 'favourite': case 'poll': await self.registration.showNotification(data.title, { + badge, icon, body, tag, @@ -175,6 +178,7 @@ async function showRichNotification (data, notification) { ].filter(Boolean) await self.registration.showNotification(data.title, { + badge, icon, body, tag, diff --git a/static/icon-push-badge.png b/static/icon-push-badge.png new file mode 100644 index 0000000000000000000000000000000000000000..557095b83801a665bf1838474660a7d6a809953b GIT binary patch literal 2144 zcmZ`(3pAAZ8~$cKjN4ePai>~$xyu+DGGScGZJEg|LOHBl#weHQVnVL1u8Oj)do2H& z3JK{GHRxj3Ey-mN3NaCDv-1D-|IV4?wCDexGw=7j&-1+RyuaUf&X?)o=7<+p5{DoN z@9bpn37*K;pC}A+Ft&gQL0Eqe7aA3mrvD2wGcyzz8XD^9>FxYKVPaweoc|WdWHJ~f z;7KIXW*eAHr_)gtOhAE#h6VscA`v*zHBbpKsKMCS7y!@Kb5Ez%0K$W zXT?(ayuW^dSKyufsfT{By+8e3iAnokxihP$uKj)PH?_jwHQlc$M4jF;_dzlza@0dy zH9K)6c((ZP<4XDJ19#__#ab`hOl}W~y-6hS)SCkmE;0A*4)4ipdXh5yyx;dHx)Z59 zjvK?OXYfB>OwV*Y7)qTOHz)u6R;ojL=nq=y46P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