Skip to content

Commit 3f5fcf4

Browse files
committed
fix: Conditionally rendered buttons based on content access in channel bottom sheet
1 parent 05b4c08 commit 3f5fcf4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/widgets/action_sheet.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,16 +451,16 @@ void showChannelActionSheet(BuildContext context, {
451451
final unreadCount = store.unreads.countInChannelNarrow(channelId);
452452
final channel = store.streams[channelId];
453453
final isSubscribed = channel is Subscription;
454+
final hasContentAccess = channel != null && store.selfHasContentAccess(channel);
454455
final buttonSections = [
455-
if (!isSubscribed
456-
&& channel != null && store.selfHasContentAccess(channel))
456+
if (!isSubscribed && hasContentAccess)
457457
[SubscribeButton(pageContext: pageContext, channelId: channelId)],
458458
[
459-
if (unreadCount > 0)
459+
if (hasContentAccess && unreadCount > 0)
460460
MarkChannelAsReadButton(pageContext: pageContext, channelId: channelId),
461-
if (showTopicListButton)
461+
if (hasContentAccess && showTopicListButton)
462462
TopicListButton(pageContext: pageContext, channelId: channelId),
463-
if (!isOnChannelFeed)
463+
if (hasContentAccess && !isOnChannelFeed)
464464
ChannelFeedButton(pageContext: pageContext, channelId: channelId),
465465
CopyChannelLinkButton(channelId: channelId, pageContext: pageContext)
466466
],

0 commit comments

Comments
 (0)