From 798ac3f85a2ac7ef655e75546f31f5841c7bba28 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 8 Apr 2021 16:28:30 +0100 Subject: [PATCH] Fix handling of logout event (#15323) (#15337) Backport #15323 It appears that there is a slight bug in the handling of the data of logout event - the javascript should be testing the data field of the data field for the logout instruction. Signed-off-by: Andrew Thornton --- web_src/js/features/notification.js | 2 +- web_src/js/features/stopwatch.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/notification.js b/web_src/js/features/notification.js index fca1ddc543..4fa2d3c29a 100644 --- a/web_src/js/features/notification.js +++ b/web_src/js/features/notification.js @@ -66,7 +66,7 @@ export async function initNotificationCount() { } else if (event.data.type === 'error') { console.error(event.data); } else if (event.data.type === 'logout') { - if (event.data !== 'here') { + if (event.data.data !== 'here') { return; } worker.port.postMessage({ diff --git a/web_src/js/features/stopwatch.js b/web_src/js/features/stopwatch.js index 9352ef292d..184451bcbb 100644 --- a/web_src/js/features/stopwatch.js +++ b/web_src/js/features/stopwatch.js @@ -47,7 +47,7 @@ export async function initStopwatch() { } else if (event.data.type === 'error') { console.error(event.data); } else if (event.data.type === 'logout') { - if (event.data !== 'here') { + if (event.data.data !== 'here') { return; } worker.port.postMessage({