Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Attempt to fix bug in dm view
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlovin committed Dec 15, 2018
1 parent 31a3351 commit 7850449
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/models/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export const getViewableParticipantThreadsByUser = async (
getParticipantCommunityIds,
]);

const participantThreadIds = participantChannelIds.map(c => c.threadId);
const participantThreadIds = participantChannelIds.map(c => c && c.threadId);
const distinctParticipantChannelIds = participantChannelIds
.map(c => c.channelId)
.filter((x, i, a) => a.indexOf(x) === i);
Expand Down
6 changes: 3 additions & 3 deletions api/queries/directMessageThread/participants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { signUser } from 'shared/imgix';

export default async ({ id }: { id: string }, _: any, ctx: GraphQLContext) => {
const { loaders, user } = ctx;
if (!user || !user.id) return null;
if (!user || !user.id) return [];

const canViewThread = await canViewDMThread(user.id, id, loaders);

if (!canViewThread) return null;
if (!canViewThread) return [];

return loaders.directMessageParticipants.load(id).then(results => {
if (!results || results.length === 0) return null;
if (!results || results.length === 0) return [];
return results.reduction.map(user => {
return signUser(user);
});
Expand Down

0 comments on commit 7850449

Please sign in to comment.