Improve logout from worker (#30775)

A quick fix for #30756
This commit is contained in:
wxiaoguang
2024-04-30 23:35:42 +08:00
committed by GitHub
parent 564102ce89
commit a988237eb4
3 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import $ from 'jquery';
import {GET} from '../modules/fetch.js';
import {toggleElem} from '../utils/dom.js';
import {logoutFromWorker} from '../modules/worker.js';
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
let notificationSequenceNumber = 0;
@ -95,7 +96,7 @@ export function initNotificationCount() {
type: 'close',
});
worker.port.close();
window.location.href = `${appSubUrl}/`;
logoutFromWorker();
} else if (event.data.type === 'close') {
worker.port.postMessage({
type: 'close',