| | |
| | | msgList.value.splice(resultItem.index, 0, ...resultItem.item); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | const historyUpdate = async (data: any) => { |
| | | if (!checkCanSync(data)) return; |
| | | if (!data) return; |
| | | Logger.info('sync message notification:\n\n' + JSON.stringify(data)); |
| | | |
| | | if (data?.type === 'chat_start') { |
| | | |
| | | showTip(data); |
| | | const groupId = unref(historyGroupId); |
| | | const startGroupId = data?.history_group_id; |
| | | if (groupId !== startGroupId) return; |
| | | const isDigitalHuman = data?.is_digital_human; |
| | | if (!isDigitalHuman) { |
| | | showTip(data); |
| | | } |
| | | } |
| | | if (data?.type === 'chat_history_id') { |
| | | const groupId = unref(historyGroupId); |
| | |
| | | updateLoadIndex(unSyncedHistoryIds.length); |
| | | scrollToBottom(); |
| | | } |
| | | |
| | | }; |
| | | |
| | | onActivated(() => { |