1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Pass api error message through to toast notification when editing a user

Any errors returned by the API when submitting edits to a user caused the loading spinner to stay on screen. This hides the spinner and makes the error message visible to the user
This commit is contained in:
SHestres 2024-12-17 07:22:36 +00:00
parent 9138734520
commit a88349f8d3

View file

@ -230,7 +230,16 @@ const UserEdit = () => {
)).then(() => {
onSaveComplete();
}).catch(err => {
console.error('[useredit] failed to update user', err);
try {
console.error('[useredit] failed to update user', err);
err.text().then((errorMessage: string) => {
toast(errorMessage);
loading.hide();
});
} catch {
toast(globalize.translate('ErrorDefault'));
loading.hide();
}
});
};