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:
parent
9138734520
commit
a88349f8d3
1 changed files with 10 additions and 1 deletions
|
@ -230,7 +230,16 @@ const UserEdit = () => {
|
||||||
)).then(() => {
|
)).then(() => {
|
||||||
onSaveComplete();
|
onSaveComplete();
|
||||||
}).catch(err => {
|
}).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();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue