diff --git a/web/src/message_parser.ts b/web/src/message_parser.ts index 211a13fa5c..d8e8b23acb 100644 --- a/web/src/message_parser.ts +++ b/web/src/message_parser.ts @@ -9,7 +9,7 @@ import type {Message} from "./message_store"; // one needs an outer element wrapping an object to use this // construction. function is_element_in_message_content(message: Message, element_selector: string): boolean { - return $(`
${message.content}
`).find(`${element_selector}`).length > 0; + return $(`
${message.content}
`).find(element_selector).length > 0; } export function message_has_link(message: Message): boolean { diff --git a/web/src/modals.ts b/web/src/modals.ts index ac05e3ada9..5f526ab95c 100644 --- a/web/src/modals.ts +++ b/web/src/modals.ts @@ -221,9 +221,9 @@ export function close_if_open(modal_id: string): void { } const $micromodal = $(".micromodal.modal--open"); - const active_modal_id = CSS.escape(`${CSS.escape($micromodal.attr("id") ?? "")}`); - if (active_modal_id === `${CSS.escape(modal_id)}`) { - Micromodal.close(`${CSS.escape($micromodal.attr("id") ?? "")}`); + const active_modal_id = CSS.escape(CSS.escape($micromodal.attr("id") ?? "")); + if (active_modal_id === CSS.escape(modal_id)) { + Micromodal.close(CSS.escape($micromodal.attr("id") ?? "")); } else { blueslip.info( `${active_modal_id} is the currently active modal and ${modal_id} is already closed.`, @@ -238,7 +238,7 @@ export function close_active(): void { } const $micromodal = $(".micromodal.modal--open"); - Micromodal.close(`${CSS.escape($micromodal.attr("id") ?? "")}`); + Micromodal.close(CSS.escape($micromodal.attr("id") ?? "")); } export function close_active_if_any(): void { diff --git a/web/src/portico/portico_modals.ts b/web/src/portico/portico_modals.ts index 22f1dfc4cb..cd7c9c097f 100644 --- a/web/src/portico/portico_modals.ts +++ b/web/src/portico/portico_modals.ts @@ -25,7 +25,7 @@ export function close_active(): void { } const $micromodal = $(".micromodal.modal--open"); - Micromodal.close(`${CSS.escape($micromodal.attr("id") ?? "")}`); + Micromodal.close(CSS.escape($micromodal.attr("id") ?? "")); } export function open(modal_id: string, recursive_call_count = 0): void {