stream_create: Live update error for duplicate stream name.

Previously, we only hided the error of already existing
archived stream on receiving event for a stream rename.

Now, we validate the stream name input on every stream
rename event.
This commit is contained in:
Sahil Batra
2025-01-10 16:22:36 +05:30
committed by Tim Abbott
parent 42fe2690e3
commit 12c2a59277
2 changed files with 5 additions and 4 deletions

View File

@@ -65,9 +65,8 @@ export function should_show_first_stream_created_modal(): boolean {
}
export function maybe_update_error_message(): void {
if ($("#stream_name_error").is(":visible") && $("#archived_stream_rename").is(":visible")) {
$("#create_stream_name").trigger("input");
}
const stream_name = $<HTMLInputElement>("input#create_stream_name").val()!.trim();
stream_name_error.pre_validate(stream_name);
}
const group_setting_widget_map = new Map<string, GroupSettingPillContainer | null>([

View File

@@ -138,7 +138,9 @@ export function update_stream_name(sub: StreamSubscription, new_name: string): v
message_view_header.maybe_rerender_title_area_for_stream(sub);
// Update the create stream error if needed
stream_create.maybe_update_error_message();
if (overlays.streams_open()) {
stream_create.maybe_update_error_message();
}
}
export function update_stream_description(