mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 03:43:39 +08:00
fix: reset save button state on failure in admin page (#4010)
This commit is contained in:
parent
f13a1c8387
commit
aafc615d67
@ -180,6 +180,13 @@ export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAt
|
||||
app.alerts.show({ type: 'success' }, app.translator.trans('core.admin.settings.saved_message'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when `saveSettings` fails to complete.
|
||||
*/
|
||||
onsavefailed(): void {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a function that fetches the setting from the `app` global.
|
||||
*/
|
||||
@ -232,7 +239,8 @@ export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAt
|
||||
app.modal.show(LoadingModal);
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(this.onsavefailed.bind(this));
|
||||
}
|
||||
|
||||
modelLocale(): Record<string, string> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user