committed by
trae-solo-agent
co-authored by
Kimi-K3.1-Pro noreply@anthropic.com
parent
d3f399d1ad
commit
d731fc1da3
@@ -23,7 +23,6 @@ App({
|
||||
|
||||
onShow() {
|
||||
this.globalData.authReady = this.silentSignin()
|
||||
this.initChatSocket()
|
||||
},
|
||||
|
||||
// 启动期资源统一走 Promise;失败后清空 Promise,页面重试可重新发起请求。
|
||||
@@ -118,28 +117,12 @@ App({
|
||||
return this.signinPromise
|
||||
},
|
||||
|
||||
// WebSocket 只服务 AI 页:这里仅懒创建,由页面发送前显式等待连接成功。
|
||||
initChatSocket() {
|
||||
if (this.globalData.chatSocket) return
|
||||
if (this.globalData.chatSocket) return this.globalData.chatSocket
|
||||
|
||||
const socket = new AIChatSocket()
|
||||
|
||||
socket.onOpen(() => {
|
||||
console.log('[App] Chat WebSocket connected')
|
||||
})
|
||||
|
||||
socket.onClose((res) => {
|
||||
console.log('[App] Chat WebSocket closed', res)
|
||||
})
|
||||
|
||||
socket.onError((err) => {
|
||||
console.error('[App] Chat WebSocket error', err)
|
||||
})
|
||||
|
||||
socket.connect().catch((err) => {
|
||||
console.error('[App] Chat WebSocket connect failed', err)
|
||||
})
|
||||
|
||||
this.globalData.chatSocket = socket
|
||||
this.globalData.chatSocket = new AIChatSocket()
|
||||
return this.globalData.chatSocket
|
||||
},
|
||||
|
||||
checkUpdate() {
|
||||
|
||||
Reference in New Issue
Block a user