Skip to content

Commit

Permalink
fix: Should auto refresh user when app start
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Oct 27, 2023
1 parent 09d4396 commit 4c88851
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xmcl-runtime/lib/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export class UserService extends StatefulService<UserState> implements IUserServ
this.log(`Load ${Object.keys(userData.users).length} users`)

this.state.userData(userData)

// Refresh all users
await Promise.all(Object.values(userData.users as Record<string, UserProfile>).map((user) => {
return this.refreshUser(user.id)
}))
})

this.userFile = createSafeFile(this.getAppDataPath('user.json'), UserSchema, this, [this.getPath('user.json')])
Expand Down

0 comments on commit 4c88851

Please sign in to comment.