mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix: send session-alive signal immediately on socket connect to prevent initial offline flicker
This commit is contained in:
@@ -102,6 +102,11 @@ export class ApiSessionClient extends EventEmitter {
|
||||
}
|
||||
void this.backfillIfNeeded()
|
||||
this.hasConnectedOnce = true
|
||||
this.socket.emit('session-alive', {
|
||||
sid: this.sessionId,
|
||||
time: Date.now(),
|
||||
thinking: false
|
||||
})
|
||||
})
|
||||
|
||||
this.socket.on('rpc-request', async (data: { method: string; params: string }, callback: (response: string) => void) => {
|
||||
|
||||
Reference in New Issue
Block a user