Skip to content

Commit 4f54dbf

Browse files
committed
channel_action_sheet: Update button visibility conditions in channel
bottom sheet MarkChannelAsReadButton, TopicListButton, and ChannelFeedButton should not be displayed for a user without content access, as the server won't provide any information the user doesn't have permission to view.
1 parent 03a6c97 commit 4f54dbf

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)