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