Skip to content

Commit

Permalink
🛠 Fix badges (QA only) (#2089)
Browse files Browse the repository at this point in the history
* Fix small error

* Fix disapearing badges
  • Loading branch information
RomaricMourgues authored Apr 14, 2022
1 parent 9d551d8 commit ccd6266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export class Service implements ChannelService {
user_id ||= options.user_id;
}

if (options?.mine || isDirectWorkspace) {
if ((options?.mine || isDirectWorkspace) && user_id) {
const userChannels = await this.channelService.members.listUserChannels(
{ id: user_id },
pagination,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ export class UserNotificationBadgeService implements UserNotificationBadgeServic

const channels = uniq(badges.getEntities().map(r => r.channel_id));
for (const channelId of channels) {
const someBadge = badges.getEntities().find(b => b.channel_id === channelId);
const channelMemberPk = {
company_id: badges.getEntities()[0].company_id,
workspace_id: badges.getEntities()[0].workspace_id,
company_id: someBadge.company_id,
workspace_id: someBadge.workspace_id,
channel_id: channelId,
user_id: userId,
};
Expand Down

0 comments on commit ccd6266

Please sign in to comment.