mirror of
https://github.com/flarum/core.git
synced 2025-08-07 17:07:19 +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'));
|
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.
|
* 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;
|
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