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

This commit is contained in:
Daniil Fadeev
2023-05-08 16:54:24 +04:00
committed by Tim Abbott
parent e0cb3c6908
commit e22c44131b

View File

@@ -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,