refactor: standardize event type naming for resync handling
This commit is contained in:
@@ -88,7 +88,7 @@ export function useAgentConversationRealtime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const store = useAgentConversationsStore.getState()
|
const store = useAgentConversationsStore.getState()
|
||||||
if (eventType === "resync.required") {
|
if (eventType === "resyncRequired") {
|
||||||
void store.resyncRealtimeData(conversationId).catch((error) => {
|
void store.resyncRealtimeData(conversationId).catch((error) => {
|
||||||
toast.error(error instanceof Error ? error.message : "同步会话数据失败")
|
toast.error(error instanceof Error ? error.message : "同步会话数据失败")
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export const useKefuChatStore = create<KefuChatStore>((set, get) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const payload = event.data ?? event.payload
|
const payload = event.data ?? event.payload
|
||||||
if (event.type === "resync.required") {
|
if (event.type === "resyncRequired") {
|
||||||
void get().refreshMessages()
|
void get().refreshMessages()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user