Skip to content

Commit

Permalink
fix: Should remove invalid user during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Feb 19, 2024
1 parent 8c89d93 commit c09ecfe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xmcl-runtime/user/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ export class UserService extends StatefulService<UserState> implements IUserServ

// Refresh all users
Promise.all(Object.values(userData.users as Record<string, UserProfile>).map((user) => {
return this.refreshUser(user.id).catch((e) => {
this.log(`Failed to refresh user ${user.id}`, e)
})
if (user.username) {
return this.refreshUser(user.id).catch((e) => {
this.log(`Failed to refresh user ${user.id}`, e)
})
} else {
return this.removeUser(user)
}
}))
})

Expand Down

0 comments on commit c09ecfe

Please sign in to comment.