mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
refactor: Extract stream_data.can_subscribe_others().
This commit is contained in:
@@ -55,11 +55,11 @@ export function update_calculated_fields(sub) {
|
||||
sub.should_display_preview_button = stream_data.can_preview(sub);
|
||||
sub.can_change_stream_permissions = stream_data.can_change_permissions(sub);
|
||||
sub.can_access_subscribers = stream_data.can_view_subscribers(sub);
|
||||
sub.can_add_subscribers = stream_data.can_subscribe_others(sub);
|
||||
|
||||
sub.preview_url = hash_util.by_stream_uri(sub.stream_id);
|
||||
// User can add other users to stream if stream is public or user is subscribed to stream.
|
||||
sub.can_add_subscribers = !page_params.is_guest && (!sub.invite_only || sub.subscribed);
|
||||
sub.is_old_stream = sub.stream_weekly_traffic !== null;
|
||||
|
||||
if (sub.rendered_description !== undefined) {
|
||||
sub.rendered_description = sub.rendered_description.replace("<p>", "").replace("</p>", "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user