mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
fix: reset admin page save button in catch (#3963)
This commit is contained in:
@@ -351,6 +351,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` completes with errors.
|
||||
*/
|
||||
onsavefailed(): void {
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a function that fetches the setting from the `app` global.
|
||||
*/
|
||||
@@ -394,6 +401,6 @@ export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAt
|
||||
|
||||
this.loading = true;
|
||||
|
||||
return saveSettings(this.dirty()).then(this.onsaved.bind(this));
|
||||
return saveSettings(this.dirty()).then(this.onsaved.bind(this)).catch(this.onsavefailed.bind(this));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user