删除分组时,把分组内是session的partitionId置为初始值0

This commit is contained in:
bob
2025-01-06 23:26:27 +08:00
parent e1a0723797
commit ae0c669689
2 changed files with 24 additions and 2 deletions

View File

@@ -141,6 +141,17 @@ const onSelectOprMenu = (label) => {
cancelButtonText: '取消'
}
).then(() => {
Object.values(messageData.sessionList).forEach((item) => {
if (
item.sessionType === MsgType.GROUP_CHAT &&
item.partitionId.toString() === selectedIndex.value
) {
messageData.updateSession({
sessionId: item.sessionId,
partitionId: 0
})
}
})
msgDeletePartitionService({ partitionId: showOprMenuPartitionId.value }).then((res) => {
if (res.data.code === 0) {
if (
@@ -278,7 +289,7 @@ const onShowGroupCardFromSelectDialog = async (groupId) => {
background: #ebedf0;
"
>
{{ partitions[addSessionPartitionId].partitionName }}
{{ partitions[addSessionPartitionId]?.partitionName }}
</div>
<div style="font-size: 16px; font-weight: bold; white-space: nowrap">添加群组</div>
</div>

View File

@@ -161,6 +161,17 @@ const onSelectOprMenu = (label) => {
cancelButtonText: '取消'
}
).then(() => {
Object.values(messageData.sessionList).forEach((item) => {
if (
item.sessionType === MsgType.CHAT &&
item.partitionId.toString() === selectedIndex.value
) {
messageData.updateSession({
sessionId: item.sessionId,
partitionId: 0
})
}
})
msgDeletePartitionService({ partitionId: showOprMenuPartitionId.value }).then((res) => {
if (res.data.code === 0) {
if (
@@ -349,7 +360,7 @@ const onShowUserCardFromSelectDialog = (account) => {
background: #ebedf0;
"
>
{{ partitions[addSessionPartitionId].partitionName }}
{{ partitions[addSessionPartitionId]?.partitionName }}
</div>
<div style="font-size: 16px; font-weight: bold; white-space: nowrap">添加联系人</div>
</div>