stream_data: Make `Subscribe` button not visible for archived streams.

This commit is contained in:
sanchi-t 2024-02-08 18:34:27 +05:30 committed by Tim Abbott
parent a917215292
commit 616e39c290
1 changed files with 2 additions and 4 deletions

View File

@ -481,11 +481,9 @@ export function can_toggle_subscription(sub: StreamSubscription): boolean {
// Spectators cannot subscribe to any streams.
//
// Note that the correctness of this logic relies on the fact that
// one cannot be subscribed to a deactivated stream, and
// deactivated streams are automatically made private during the
// archive stream process.
// one cannot be subscribed to a deactivated stream.
return (
(sub.subscribed || (!current_user.is_guest && !sub.invite_only)) &&
(sub.subscribed || (!current_user.is_guest && !(sub.invite_only || sub.is_archived))) &&
!page_params.is_spectator
);
}