Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
compose_banner: Return boolean value from append function.
Maneesh Shuklaf6053ed15b56
diff --git a/web/src/compose_banner.ts b/web/src/compose_banner.tsindex fd673f4a6d1..f92f443f0d8 100644--- a/web/src/compose_banner.ts+++ b/web/src/compose_banner.ts@@ -71,11 +71,13 @@ export function get_compose_banner_container($textarea: JQuery): JQuery {// This function provides a convenient way to add new elements// to a banner container. The function accepts a container element// as a parameter, to which a banner should be appended.+// Returns a boolean value indicating whether the append had succeeded.export function append_compose_banner_to_banner_list($banner: JQuery,$list_container: JQuery,-): void {+): boolean {scroll_util.get_content_element($list_container).append($banner);+ return true;}export function update_or_append_banner(diff --git a/web/src/compose_validate.ts b/web/src/compose_validate.tsindex f9119f8e9b9..1fbb13ea102 100644--- a/web/src/compose_validate.ts+++ b/web/src/compose_validate.ts@@ -359,8 +359,13 @@ export function warn_if_topic_resolved(topic_changed: boolean): void {};const new_row_html = render_compose_banner(context);- compose_banner.append_compose_banner_to_banner_list($(new_row_html), $("#compose_banners"));- compose_state.set_recipient_viewed_topic_resolved_banner(true);+ const appended = compose_banner.append_compose_banner_to_banner_list(+ $(new_row_html),+ $("#compose_banners"),+ );+ if (appended) {+ compose_state.set_recipient_viewed_topic_resolved_banner(true);+ }} else {clear_topic_resolved_warning();}