ui_report: Rename btn -> button in JS variables.

This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
This commit is contained in:
Sayam Samal 2024-11-13 18:10:47 +05:30 committed by Tim Abbott
parent 1cc66fbad4
commit afa537e35c
1 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ export function generic_embed_error(error_html: string, remove_after?: number):
}
}
export function generic_row_button_error(xhr: JQuery.jqXHR, $btn: JQuery): void {
export function generic_row_button_error(xhr: JQuery.jqXHR, $button: JQuery): void {
let parsed;
if (
xhr.status >= 400 &&
@ -76,9 +76,9 @@ export function generic_row_button_error(xhr: JQuery.jqXHR, $btn: JQuery): void
(parsed = z.object({msg: z.string()}).safeParse(xhr.responseJSON)).success
) {
const $error = $("<p>").addClass("text-error").text(parsed.data.msg);
$btn.closest("td").empty().append($error);
$button.closest("td").empty().append($error);
} else {
$btn.text($t({defaultMessage: "Failed!"}));
$button.text($t({defaultMessage: "Failed!"}));
}
}