diff options
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/eventsource.sharedworker.js | 1 | ||||
-rw-r--r-- | web_src/js/features/notification.js | 5 | ||||
-rw-r--r-- | web_src/js/features/stopwatch.js | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/web_src/js/features/eventsource.sharedworker.js b/web_src/js/features/eventsource.sharedworker.js index 6a6ee154db..ff160cdc52 100644 --- a/web_src/js/features/eventsource.sharedworker.js +++ b/web_src/js/features/eventsource.sharedworker.js @@ -10,6 +10,7 @@ class Source { this.listening = {}; this.clients = []; this.listen('open'); + this.listen('close'); this.listen('logout'); this.listen('notification-count'); this.listen('stopwatches'); diff --git a/web_src/js/features/notification.js b/web_src/js/features/notification.js index a0793d2286..fca1ddc543 100644 --- a/web_src/js/features/notification.js +++ b/web_src/js/features/notification.js @@ -74,6 +74,11 @@ export async function initNotificationCount() { }); worker.port.close(); window.location.href = AppSubUrl; + } else if (event.data.type === 'close') { + worker.port.postMessage({ + type: 'close', + }); + worker.port.close(); } }); worker.port.addEventListener('error', (e) => { diff --git a/web_src/js/features/stopwatch.js b/web_src/js/features/stopwatch.js index 61f19bd795..9352ef292d 100644 --- a/web_src/js/features/stopwatch.js +++ b/web_src/js/features/stopwatch.js @@ -55,6 +55,11 @@ export async function initStopwatch() { }); worker.port.close(); window.location.href = AppSubUrl; + } else if (event.data.type === 'close') { + worker.port.postMessage({ + type: 'close', + }); + worker.port.close(); } }); worker.port.addEventListener('error', (e) => { |