Skip to content

Commit 80e70f4

Browse files
authored
fix: reset admin page save button in catch (#3963)
1 parent e43530e commit 80e70f4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

framework/core/js/src/admin/components/AdminPage.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAt
351351
app.alerts.show({ type: 'success' }, app.translator.trans('core.admin.settings.saved_message'));
352352
}
353353

354+
/**
355+
* Called when `saveSettings` completes with errors.
356+
*/
357+
onsavefailed(): void {
358+
this.loading = false;
359+
}
360+
354361
/**
355362
* Returns a function that fetches the setting from the `app` global.
356363
*/
@@ -394,6 +401,6 @@ export default abstract class AdminPage<CustomAttrs extends IPageAttrs = IPageAt
394401

395402
this.loading = true;
396403

397-
return saveSettings(this.dirty()).then(this.onsaved.bind(this));
404+
return saveSettings(this.dirty()).then(this.onsaved.bind(this)).catch(this.onsavefailed.bind(this));
398405
}
399406
}

0 commit comments

Comments
 (0)