Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rushidhanwant committed Mar 25, 2023
1 parent 56381f1 commit 59cd761
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/web/src/pages/[id]/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ const Profile = () => {
await trpcProxy.community.fetchCommunityUsingStreamId.query({
streamId: communityId,
});
console.log("communityNode", communityNode);
if (has(communityNode, "value.node.id")) {
//below statement should be optimised . INstead checking 1st index of array it should be checked for discord paltform.It is just a fix for now.
if (has(communityNode, "value.node.socialPlatforms.edges[1]")) {
return;
}
const devnodePlatform = get(
communityNode,
"value.node.socialPlatforms.edges[0]"
);
const userStreamId = get(devnodePlatform, "node.userId");
console.log("userStreamId",userStreamId,"state.user.id",state.user.id);
console.log(
"userStreamId",
userStreamId,
"state.user.id",
state.user.id
);
if (userStreamId === state.user.id) {
setIsAdmin(true);
}
Expand Down

0 comments on commit 59cd761

Please sign in to comment.