billing/remote_billing_auth: Fix TypeScript noUncheckedIndexedAccess errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-05-30 10:07:58 -07:00
parent 01677db59e
commit c2c2e0b9ea
1 changed files with 4 additions and 7 deletions

View File

@ -55,13 +55,10 @@ export function initialize(): void {
},
showErrors(error_map) {
$("*[class$='-error']").hide();
for (const key in error_map) {
if (Object.prototype.hasOwnProperty.call(error_map, key)) {
const error = error_map[key];
const $error_element = $(`.${CSS.escape(key)}-error`);
$error_element.text(error);
$error_element.show();
}
for (const [key, error] of Object.entries(error_map)) {
const $error_element = $(`.${CSS.escape(key)}-error`);
$error_element.text(error);
$error_element.show();
}
},
});