Update worker.js

This commit is contained in:
wxiaoguang 2024-04-30 23:05:11 +08:00 committed by GitHub
parent 24f06bfc32
commit 147fdc833c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -1,8 +1,9 @@
import {sleep} from '../utils.js';
const {appSubUrl} = window.config;
export function logoutFromWorker() {
export async function logoutFromWorker() {
// wait for a while because other requests (eg: logout) may be in the flight
setTimeout(() => {
window.location.href = `${appSubUrl}/`;
}, 5000);
await sleep(5000);
window.location.href = `${appSubUrl}/`;
}