mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-25 19:39:46 +01:00
Only setup event stream when mounting the app
This commit is contained in:
parent
0c93db816c
commit
a77635e883
2 changed files with 11 additions and 9 deletions
|
|
@ -14,7 +14,7 @@ let timeout = null
|
|||
const getEventStream = async () => {
|
||||
if (!es) {
|
||||
// Call `keepalive` to refresh the jwt token
|
||||
await httpClient(`${REST_URL}/keepalive/eventSource`)
|
||||
await httpClient(`${REST_URL}/keepalive/keepalive`)
|
||||
es = new EventSource(
|
||||
baseUrl(`${REST_URL}/events?jwt=${localStorage.getItem('token')}`)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue