H-43: fix WEB Captain takeover E2E flow (#8)
* test(shangwutong): cover CID rename reliability * H-43: fix WEB Captain takeover flow * H-48: preserve compatible provider model * H-49: make Captain takeover atomic * H-50: prevent duplicate widget initialization --------- Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -245,7 +245,8 @@ export const mutations = {
|
||||
if (!conversation?.id) return;
|
||||
|
||||
const { allConversations } = _state;
|
||||
const index = allConversations.findIndex(c => c.id === conversation.id);
|
||||
const normalizedId = Number(conversation.id);
|
||||
const index = allConversations.findIndex(c => Number(c.id) === normalizedId);
|
||||
|
||||
if (index > -1) {
|
||||
const selectedConversation = allConversations[index];
|
||||
@@ -256,8 +257,12 @@ export const mutations = {
|
||||
}
|
||||
|
||||
const { messages, ...updates } = conversation;
|
||||
allConversations[index] = { ...selectedConversation, ...updates };
|
||||
if (_state.selectedChatId === conversation.id) {
|
||||
allConversations[index] = {
|
||||
...selectedConversation,
|
||||
...updates,
|
||||
id: selectedConversation.id,
|
||||
};
|
||||
if (Number(_state.selectedChatId) === normalizedId) {
|
||||
emitter.emit(BUS_EVENTS.SCROLL_TO_MESSAGE);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user