This commit is contained in:
49lf
2024-04-23 16:21:21 -04:00
parent 66ddce1348
commit 343ed04f7d

View File

@ -651,16 +651,17 @@ class EngineConnection extends EventTarget {
}, },
} }
// Send an initial ping
this.send({ type: 'ping' })
this.pingPongSpan.ping = new Date()
// This is required for when KCMA is running stand-alone / within Tauri. // This is required for when KCMA is running stand-alone / within Tauri.
// Otherwise when run in a browser, the token is sent implicitly via // Otherwise when run in a browser, the token is sent implicitly via
// the Cookie header. // the Cookie header.
if (this.token) { if (this.token) {
this.send({ headers: { Authorization: `Bearer ${this.token}` } }) this.send({ headers: { Authorization: `Bearer ${this.token}` } })
} }
// Send an initial ping
this.send({ type: 'ping' })
this.pingPongSpan.ping = new Date()
}) })
this.websocket.addEventListener('close', (event) => { this.websocket.addEventListener('close', (event) => {