增加前端格式检查配置
This commit is contained in:
@@ -49,18 +49,22 @@ export function useChatSSE(scope: AuthScope, endpoint: string) {
|
||||
connected.value = true
|
||||
})
|
||||
|
||||
source.addEventListener('new_message', (e) => {
|
||||
source.addEventListener('new_message', e => {
|
||||
try {
|
||||
const data = JSON.parse((e as MessageEvent).data) as ChatEvent
|
||||
handlers.forEach(h => h(data))
|
||||
} catch { /* ignore */ }
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
})
|
||||
|
||||
source.addEventListener('conversation_updated', (e) => {
|
||||
source.addEventListener('conversation_updated', e => {
|
||||
try {
|
||||
const data = JSON.parse((e as MessageEvent).data) as ChatEvent
|
||||
handlers.forEach(h => h(data))
|
||||
} catch { /* ignore */ }
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
})
|
||||
|
||||
source.onerror = async () => {
|
||||
|
||||
Reference in New Issue
Block a user