|
|
@@ -1029,6 +1029,9 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ // 先保存引用,避免被 closeActionMenu 清空
|
|
|
+ const conversation = this.selectedConversation;
|
|
|
+
|
|
|
uni.showModal({
|
|
|
title: '确认删除',
|
|
|
content: '确定要删除该会话吗?',
|
|
|
@@ -1036,10 +1039,10 @@ export default {
|
|
|
if (res.confirm) {
|
|
|
try {
|
|
|
// 调用 TIM SDK 删除会话
|
|
|
- await timManager.tim.deleteConversation(this.selectedConversation.id);
|
|
|
+ await timManager.tim.deleteConversation(conversation.id);
|
|
|
|
|
|
// 从列表中移除
|
|
|
- const index = this.conversations.findIndex(c => c.id === this.selectedConversation.id);
|
|
|
+ const index = this.conversations.findIndex(c => c.id === conversation.id);
|
|
|
if (index > -1) {
|
|
|
this.conversations.splice(index, 1);
|
|
|
}
|
|
|
@@ -1063,10 +1066,10 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ // 在回调结束后关闭菜单
|
|
|
+ this.closeActionMenu();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- this.closeActionMenu();
|
|
|
},
|
|
|
|
|
|
/**
|