mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-14 15:05:57 +08:00
refac
This commit is contained in:
parent
cbe84d7139
commit
71288ea3f2
@ -541,6 +541,12 @@
|
|||||||
|
|
||||||
$socket?.on('chat-events', chatEventHandler);
|
$socket?.on('chat-events', chatEventHandler);
|
||||||
$socket?.on('channel-events', channelEventHandler);
|
$socket?.on('channel-events', channelEventHandler);
|
||||||
|
|
||||||
|
// Set up the token expiry check
|
||||||
|
if (tokenTimer) {
|
||||||
|
clearInterval(tokenTimer);
|
||||||
|
}
|
||||||
|
tokenTimer = setInterval(checkTokenExpiry, 15000);
|
||||||
} else {
|
} else {
|
||||||
$socket?.off('chat-events', chatEventHandler);
|
$socket?.off('chat-events', chatEventHandler);
|
||||||
$socket?.off('channel-events', channelEventHandler);
|
$socket?.off('channel-events', channelEventHandler);
|
||||||
@ -593,12 +599,6 @@
|
|||||||
|
|
||||||
await user.set(sessionUser);
|
await user.set(sessionUser);
|
||||||
await config.set(await getBackendConfig());
|
await config.set(await getBackendConfig());
|
||||||
|
|
||||||
// Set up the token expiry check
|
|
||||||
if (tokenTimer) {
|
|
||||||
clearInterval(tokenTimer);
|
|
||||||
}
|
|
||||||
tokenTimer = setInterval(checkTokenExpiry, 1000);
|
|
||||||
} else {
|
} else {
|
||||||
// Redirect Invalid Session User to /auth Page
|
// Redirect Invalid Session User to /auth Page
|
||||||
localStorage.removeItem('token');
|
localStorage.removeItem('token');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user