Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_create: Live update error for duplicate stream name.

Sahil Batra12c2a59277fa
diff --git a/web/src/stream_create.ts b/web/src/stream_create.ts
index d87e757540a..7a67e7fc819 100644
--- a/web/src/stream_create.ts
+++ b/web/src/stream_create.ts
@@ -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>([
diff --git a/web/src/stream_settings_ui.ts b/web/src/stream_settings_ui.ts
index 34c4abae0b7..5bc3cad3d5d 100644
--- a/web/src/stream_settings_ui.ts
+++ b/web/src/stream_settings_ui.ts
@@ -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(