fix: add push notification badge (#1246)

This commit is contained in:
Nolan Lawson 2019-05-27 14:25:45 -07:00 committed by GitHub
parent 3a2c56f0fa
commit 8c74d0c7c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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,

BIN
static/icon-push-badge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB