mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
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:
@@ -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>([
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user