invites: Allow users to invite without specifying any stream to join.

We now allow users to invite without specifying any stream to join.
In such cases, the user would join the default streams, if any, during
the process of account creation after accepting the invite.

It is also fine if there are no default streams and user isn't
subscribed to any stream initially.
This commit is contained in:
Sahil Batra
2023-04-26 22:50:44 +05:30
committed by Tim Abbott
parent 875bcb183e
commit 4ca887bade
5 changed files with 21 additions and 15 deletions

View File

@@ -260,9 +260,8 @@ function open_invite_user_modal(e) {
function toggle_invite_submit_button() {
$("#invite-user-modal .dialog_submit_button").prop(
"disabled",
($("#invitee_emails").val().trim() === "" &&
!$("#generate_multiuse_invite_radio").is(":checked")) ||
$("#streams_to_add input:checked").length === 0,
$("#invitee_emails").val().trim() === "" &&
!$("#generate_multiuse_invite_radio").is(":checked"),
);
}
@@ -326,10 +325,6 @@ function open_invite_user_modal(e) {
$("#invite_uncheck_all_button").on("click", () => {
$("#streams_to_add input[type=checkbox]").prop("checked", false);
$("#invite-user-modal .dialog_submit_button").prop(
"disabled",
!$("#generate_multiuse_invite_radio").is(":checked"),
);
});
}