This makes it not ideal to return a ValidationException in Saving events, nor for other cases where unexpected errors occur since the user must refresh the page to reset the state.
Steps to Reproduce
Go to a settings page of an extension
Click the save button (make sure an error response will be returned from the saving endpoint)
Expected Behavior
Save button is not in loading state after receiving the server response.
Current Behavior
While saving settings, some errors might occur, however, the state of the save button won't reset if an error occurs in
saveSettings()
https://github.com/flarum/framework/blob/721e2eae3db2ca59116d17f7b001298d99418953/framework/core/js/src/admin/components/AdminPage.tsx#L412
This makes it not ideal to return a
ValidationException
inSaving
events, nor for other cases where unexpected errors occur since the user must refresh the page to reset the state.Steps to Reproduce
Expected Behavior
Save button is not in loading state after receiving the server response.
Screenshots
Environment
Output of
php flarum info
Possible Solution
Add a catch handler for
saveSettings()
's promise and reset the save button stateAdditional Context
No response