stream_create: Select the first enabled choice by default.

We select the first enabled radio button by default instead
of selecting "Public" because there can be case when a user
is allowed to create a private-stream only and the other
options are disabled in that case after some recent changes.
This commit is contained in:
Sahil Batra
2021-11-25 16:43:46 +05:30
committed by Tim Abbott
parent 969bb2bf76
commit 988e9d2abc

View File

@@ -338,9 +338,10 @@ export function show_new_stream_modal() {
html_selector: (user) => $(`#${CSS.escape("user_checkbox_" + user.user_id)}`),
});
// Select the first enabled choice for stream privacy.
$("#make-invite-only input:not([disabled]):first").prop("checked", true);
// Make the options default to the same each time:
// public, "announce stream" on.
$("#make-invite-only input:radio[value=public]").prop("checked", true);
// "announce stream" on.
$("#stream_creation_form .stream-message-retention-days-input").hide();
$("#stream_creation_form select[name=stream_message_retention_setting]").val("realm_default");