最近会话有问题

This commit is contained in:
XiuYun CHEN 2025-07-15 11:55:02 +08:00
parent c46d9848f0
commit b843007d7a

View File

@ -5,6 +5,7 @@
* *
*/ */
import { patientDbManager } from '@itcast/basic'
import { ChatKitClient, LocalConversationRepo, TeamRepo } from '@nimkit/chatkit' import { ChatKitClient, LocalConversationRepo, TeamRepo } from '@nimkit/chatkit'
import { import {
V2NIMConnectStatus, V2NIMConnectStatus,
@ -242,6 +243,15 @@ export class LocalConversationViewModel {
conversation.conversationId)) conversation.conversationId))
} }
this.conversationList?.push(...newConversation) this.conversationList?.push(...newConversation)
//异步有问题
if (this.conversationList.length > 0 ) {
const resultconversationList =await this.conversationList.filter(async conversation =>
await patientDbManager.getPatientByUuid(ChatKitClient.nim.conversationIdUtil.parseConversationTargetId(conversation.conversationId))!=null
)
this.conversationList =resultconversationList;
}
this.conversationList?.sort((a, b) => this.sortConversation(a, b)) this.conversationList?.sort((a, b) => this.sortConversation(a, b))
this.isFinishedSyncLoad = true this.isFinishedSyncLoad = true
console.debug(`Performance Test finish loadLocalConversation`) console.debug(`Performance Test finish loadLocalConversation`)