mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-09-07 23:25:13 +08:00
reduce unneeded requests to web-auth-requests/stream
This commit is contained in:
parent
c315c72bc2
commit
76c6c5440d
1 changed files with 7 additions and 5 deletions
|
@ -20,7 +20,6 @@
|
|||
|
||||
async function init () {
|
||||
await serverInfoPromise
|
||||
reloadWebAuthRequests()
|
||||
}
|
||||
|
||||
function onPageResume () {
|
||||
|
@ -87,11 +86,14 @@
|
|||
} catch {
|
||||
// ignore
|
||||
}
|
||||
socket = new WebSocket(`wss://${location.host}/@warpgate/api/auth/web-auth-requests/stream`)
|
||||
socket.addEventListener('message', () => {
|
||||
socket = null
|
||||
if ($serverInfo?.username) {
|
||||
socket = new WebSocket(`wss://${location.host}/@warpgate/api/auth/web-auth-requests/stream`)
|
||||
socket.addEventListener('message', () => {
|
||||
reloadWebAuthRequests()
|
||||
})
|
||||
reloadWebAuthRequests()
|
||||
})
|
||||
reloadWebAuthRequests()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue