]> source.dussan.org Git - gitea.git/commitdiff
Fix handling of logout event (#15323)
authorzeripath <art27@cantab.net>
Wed, 7 Apr 2021 23:48:13 +0000 (00:48 +0100)
committerGitHub <noreply@github.com>
Wed, 7 Apr 2021 23:48:13 +0000 (02:48 +0300)
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 <art27@cantab.net>
web_src/js/features/notification.js
web_src/js/features/stopwatch.js

index fca1ddc5439de119a90c64c2608a5ce3755878e6..4fa2d3c29af313b18e197bf6d0a2343261b83064 100644 (file)
@@ -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({
index ed20ca3227dfe48d148529c2d2c2a1b391095206..d664f0d5f2f540a570271e8e2e5246315a789a3d 100644 (file)
@@ -48,7 +48,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({