Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
fix: catch null and undefined channel permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
hirbod committed Nov 1, 2023
1 parent 9234514 commit 74a8d09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/app/components/profile/tokens-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ export const TokensTabHeader = ({
<View tw="flex-row items-center justify-between py-4">
<View tw="flex-row items-center justify-between">
<View tw="-mt-0.5 mr-2">
{channelPermissions?.can_view_creator_messages ? (
{(channelPermissions &&
!channelPermissions?.can_view_creator_messages) ||
!channelPermissions ? (
<Lock
width={20}
height={20}
Expand All @@ -161,7 +163,8 @@ export const TokensTabHeader = ({
</Text>
) : (
<Text tw="text-13 font-bold text-gray-900 dark:text-gray-50">
{!channelPermissions?.can_view_creator_messages
{channelPermissions &&
!channelPermissions?.can_view_creator_messages
? `You've unlocked ${channelMessageCountFormatted} messages`
: `Channel locked (${channelMessageCountFormatted} messages)`}
</Text>
Expand Down

0 comments on commit 74a8d09

Please sign in to comment.