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.

compose: Use the passed container value to remove the banner.

Daniil Fadeeve22c44131bf8
diff --git a/web/src/compose_banner.ts b/web/src/compose_banner.ts
index dbd4ac7d2b0..a7565f33f35 100644
--- a/web/src/compose_banner.ts
+++ b/web/src/compose_banner.ts
@@ -106,7 +106,9 @@ export function show_error_message(
$container: JQuery,
$bad_input?: JQuery,
): void {
- $(`#compose_banners .${CSS.escape(classname)}`).remove();
+ // To prevent the same banner from appearing twice,
+ // we remove the banner with a matched classname.
+ $container.find(`.${CSS.escape(classname)}`).remove();
const new_row = render_compose_banner({
banner_type: ERROR,