compose_banner: Add update_or_append_banner method in compose_banner.

`update_or_append_banner` abstracts the logic for not creating another compose
banner if one is already present in the DOM, it just replaces the content of the
old banner with the new one.
This commit is contained in:
Lalit
2023-05-09 16:34:01 +05:30
committed by Tim Abbott
parent 577c150ffa
commit 407629b46c
3 changed files with 20 additions and 1 deletions

View File

@@ -262,7 +262,11 @@ function show_wildcard_warnings(opts) {
);
} else {
// if there is already a banner, replace it with the new one
opts.$banner_container.find(`.${CSS.escape(classname)}`).replaceWith(wildcard_template);
compose_banner.update_or_append_banner(
wildcard_template,
classname,
opts.$banner_container,
);
}
user_acknowledged_wildcard = false;