Fix not disabling the Reload button correctly

This commit is contained in:
redphx 2024-07-27 16:33:40 +07:00
parent 6e17c2e24b
commit 8742da0531
2 changed files with 4 additions and 4 deletions

View File

@ -4272,8 +4272,8 @@ class SettingsNavigationDialog extends NavigationDialog {
classes: ["bx-settings-reload-button", "bx-gone"], classes: ["bx-settings-reload-button", "bx-gone"],
style: ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH, style: ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH,
onClick: (e) => { onClick: (e) => {
const $target = e.target; const $target = e.target.closest("button");
$target.disabled = !0, $target.textContent = t("settings-reloading"), window.location.reload(); $target.disabled = !0, $target.firstElementChild.textContent = t("settings-reloading"), window.location.reload();
} }
}), topButtons.push(this.$btnGlobalReload), this.$noteGlobalReload = CE("span", { }), topButtons.push(this.$btnGlobalReload), this.$noteGlobalReload = CE("span", {
class: "bx-settings-reload-note" class: "bx-settings-reload-note"

View File

@ -122,9 +122,9 @@ export class SettingsNavigationDialog extends NavigationDialog {
classes: ['bx-settings-reload-button', 'bx-gone'], classes: ['bx-settings-reload-button', 'bx-gone'],
style: ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH, style: ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH,
onClick: e => { onClick: e => {
const $target = e.target as HTMLButtonElement; const $target = (e.target as HTMLButtonElement).closest('button')!;
$target.disabled = true; $target.disabled = true;
$target.textContent = t('settings-reloading'); $target.firstElementChild!.textContent = t('settings-reloading');
window.location.reload(); window.location.reload();
}, },