feat(im): 清理一些 TODO 的修复
parent
a9f54fdee1
commit
4e181564b8
|
|
@ -608,11 +608,10 @@ async function onMuteAllChange(value: boolean | string | number) {
|
||||||
if (!props.group) {
|
if (!props.group) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// TODO @AI:不要用 next,最好是类似 newValue 这种,更好理解。
|
const newValue = !!value
|
||||||
const next = !!value
|
|
||||||
try {
|
try {
|
||||||
await muteAll({ groupId: props.group.id, mutedAll: next })
|
await muteAll({ groupId: props.group.id, mutedAll: newValue })
|
||||||
message.success(next ? '已开启全群禁言' : '已关闭全群禁言')
|
message.success(newValue ? '已开启全群禁言' : '已关闭全群禁言')
|
||||||
emit('reload')
|
emit('reload')
|
||||||
} catch {
|
} catch {
|
||||||
message.error('操作失败')
|
message.error('操作失败')
|
||||||
|
|
|
||||||
|
|
@ -725,17 +725,16 @@ export const useGroupStore = defineStore('imGroupStore', {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO @AI:vo 改成 group,更好理解点;
|
function convertGroup(group: ImGroupRespVO): Group {
|
||||||
function convertGroup(vo: ImGroupRespVO): Group {
|
|
||||||
return {
|
return {
|
||||||
id: vo.id,
|
id: group.id,
|
||||||
name: vo.name,
|
name: group.name,
|
||||||
avatar: vo.avatar,
|
avatar: group.avatar,
|
||||||
notice: vo.notice,
|
notice: group.notice,
|
||||||
ownerUserId: vo.ownerUserId,
|
ownerUserId: group.ownerUserId,
|
||||||
pinnedMessages: vo.pinnedMessages?.map(convertGroupMessageVO),
|
pinnedMessages: group.pinnedMessages?.map(convertGroupMessageVO),
|
||||||
mutedAll: vo.mutedAll,
|
mutedAll: group.mutedAll,
|
||||||
banned: vo.banned
|
banned: group.banned
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue