mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix complexity warnings in user routes
This commit is contained in:
parent
8f730b8270
commit
9c128b8c10
4 changed files with 31 additions and 51 deletions
|
@ -30,12 +30,8 @@ const UserProfile: FunctionComponent = () => {
|
|||
|
||||
loading.show();
|
||||
window.ApiClient.getUser(userId).then(function (user) {
|
||||
if (!user.Name) {
|
||||
throw new Error('Unexpected null user.Name');
|
||||
}
|
||||
|
||||
if (!user.Id) {
|
||||
throw new Error('Unexpected null user.Id');
|
||||
if (!user.Name || !user.Id) {
|
||||
throw new Error('Unexpected null user name or id');
|
||||
}
|
||||
|
||||
setUserName(user.Name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue