From 308c7197c7845edfd2123e762813d124dd26d01a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 14 Mar 2023 13:55:20 +0100 Subject: [PATCH] Resolve #1007 --- cli/release.php | 5 ----- dev/Stores/User/Notification.js | 7 +++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cli/release.php b/cli/release.php index a759bf8ae..378475ce0 100755 --- a/cli/release.php +++ b/cli/release.php @@ -160,11 +160,6 @@ $tar->addFromString('index.php', $index); $zip->addFile('README.md'); $tar->addFile('README.md'); -$data = file_get_contents('dev/serviceworker.js'); -//$data = file_get_contents('snappymail/v/0.0.0/static/js/min/serviceworker.min.js'); -$zip->addFromString('serviceworker.js', $data); -$tar->addFromString('serviceworker.js', $data); - $zip->close(); $tar->compress(Phar::GZ); diff --git a/dev/Stores/User/Notification.js b/dev/Stores/User/Notification.js index 5771fc3e6..f126ba0ab 100644 --- a/dev/Stores/User/Notification.js +++ b/dev/Stores/User/Notification.js @@ -1,4 +1,4 @@ -import * as Links from 'Common/Links'; +import { staticLink } from 'Common/Links'; import { addObservablesTo } from 'External/ko'; import { fireEvent } from 'Common/Globals'; @@ -61,7 +61,7 @@ export const NotificationUserStore = new class { if (DesktopNotifications && NotificationsGranted()) { const options = { body: text, - icon: imageSrc || Links.staticLink('images/icon-message-notification.png'), + icon: imageSrc || staticLink('images/icon-message-notification.png'), data: messageData }; if (messageData?.uid) { @@ -69,8 +69,7 @@ export const NotificationUserStore = new class { } if (WorkerNotifications) { // Service-Worker-Allowed HTTP header to allow the scope. - WorkerNotifications.register('./serviceworker.js') -// WorkerNotifications.register(Links.staticLink('js/serviceworker.js'), {scope:'/'}) + WorkerNotifications.register(staticLink('js/serviceworker.js'), {scope:'/'}) .then(() => WorkerNotifications.ready.then(registration => /* Show the notification */