diff --git a/migrations/026_add_notification_tokens.py b/migrations/026_add_notification_tokens.py index 08d95cbf7..37506c406 100644 --- a/migrations/026_add_notification_tokens.py +++ b/migrations/026_add_notification_tokens.py @@ -33,7 +33,6 @@ def migrate(migrator, database, fake=False, **kwargs): migrator.add_fields( User, notification_tokens=JSONField(default=[]), - ) diff --git a/web/public/images/maskable-badge.png b/web/public/images/maskable-badge.png new file mode 100644 index 000000000..93a0d561e Binary files /dev/null and b/web/public/images/maskable-badge.png differ diff --git a/web/public/notifications-worker.ts b/web/public/notifications-worker.ts index 8b6067a60..95b7fe72d 100644 --- a/web/public/notifications-worker.ts +++ b/web/public/notifications-worker.ts @@ -8,16 +8,11 @@ self.addEventListener("push", function (event) { // @ts-expect-error we know this exists self.registration.showNotification(data.title, { body: data.message, - icon: data.image, + icon: "/images/maskable-icon.png", image: data.image, + badge: "/images/maskable-badge.png", tag: data.id, data: { id: data.id, link: data.direct_url }, - actions: [ - { - action: `view-${data.id}`, - title: "View", - }, - ], }); } else { // pass diff --git a/web/site.webmanifest b/web/site.webmanifest index 53a45654b..94e455ec8 100644 --- a/web/site.webmanifest +++ b/web/site.webmanifest @@ -20,6 +20,12 @@ "sizes": "180x180", "type": "image/png", "purpose": "maskable" + }, + { + "src": "/images/maskable-badge.png", + "sizes": "96x96", + "type": "image/png", + "purpose": "maskable" } ], "theme_color": "#ffffff",