bookend: Simplify show_button check.

This lets us use a common function with the same logic, and thus
delete the need for a comment explaining why we think the logic is
correct.
This commit is contained in:
Tim Abbott
2021-11-15 18:02:19 -08:00
parent 0ce2ae1782
commit 2b59148e21

View File

@@ -253,10 +253,7 @@ export class MessageList {
show_button = false;
} else if (!subscribed && !this.last_message_historical) {
just_unsubscribed = true;
// For invite only streams hide the resubscribe button
// Hide button for guest users and spectators
show_button = !page_params.is_guest && !sub.invite_only;
show_button = stream_data.can_toggle_subscription(sub);
}
this.view.render_trailing_bookend(
stream_name,