mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
fix: reset save button state on failure in admin page (#4010)
This commit is contained in:
@@ -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> {
|
||||
|
Reference in New Issue
Block a user