fix: add push notification badge (#1246)
This commit is contained in:
parent
3a2c56f0fa
commit
8c74d0c7c8
|
@ -134,10 +134,12 @@ async function showRichNotification (data, notification) {
|
||||||
const { icon, body } = data
|
const { icon, body } = data
|
||||||
const tag = notification.id
|
const tag = notification.id
|
||||||
const { origin } = self.location
|
const { origin } = self.location
|
||||||
|
const badge = '/icon-push-badge.png'
|
||||||
|
|
||||||
switch (notification.type) {
|
switch (notification.type) {
|
||||||
case 'follow': {
|
case 'follow': {
|
||||||
await self.registration.showNotification(data.title, {
|
await self.registration.showNotification(data.title, {
|
||||||
|
badge,
|
||||||
icon,
|
icon,
|
||||||
body,
|
body,
|
||||||
tag,
|
tag,
|
||||||
|
@ -151,6 +153,7 @@ async function showRichNotification (data, notification) {
|
||||||
case 'favourite':
|
case 'favourite':
|
||||||
case 'poll':
|
case 'poll':
|
||||||
await self.registration.showNotification(data.title, {
|
await self.registration.showNotification(data.title, {
|
||||||
|
badge,
|
||||||
icon,
|
icon,
|
||||||
body,
|
body,
|
||||||
tag,
|
tag,
|
||||||
|
@ -175,6 +178,7 @@ async function showRichNotification (data, notification) {
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
|
|
||||||
await self.registration.showNotification(data.title, {
|
await self.registration.showNotification(data.title, {
|
||||||
|
badge,
|
||||||
icon,
|
icon,
|
||||||
body,
|
body,
|
||||||
tag,
|
tag,
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Loading…
Reference in New Issue