Skip to content

Commit

Permalink
fix: 修复新加入成员不会更新群组列表的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Dec 31, 2022
1 parent 1f53781 commit df3da7e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server/services/core/group/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class GroupService extends TcService {

const group: Group = await this.transformDocuments(ctx, {}, doc);

this.notifyGroupInfoUpdate(ctx, group);
this.notifyGroupInfoUpdate(ctx, group); // 推送变更
this.unicastNotify(ctx, userId, 'add', group);

const textPanelIds = this.getGroupTextPanelIds(group);
Expand Down Expand Up @@ -993,10 +993,14 @@ class GroupService extends TcService {
group: Group
): Promise<Group> {
const groupId = String(group._id);
const json = await this.transformDocuments(ctx, {}, group);
let json = group;
if (_.isPlainObject(group) === false) {
// 当传入的数据为group doc时
json = await this.transformDocuments(ctx, {}, group);
}

this.cleanGroupInfoCache(groupId);
this.roomcastNotify(ctx, groupId, 'updateInfo', json);
await this.roomcastNotify(ctx, groupId, 'updateInfo', json);

return json;
}
Expand Down

0 comments on commit df3da7e

Please sign in to comment.