Skip to content

Commit

Permalink
runfix: Make sure we save new users loaded via the user modal (#15843)
Browse files Browse the repository at this point in the history
  • Loading branch information
atomrc authored Sep 18, 2023
1 parent 1fda360 commit 2979a63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/script/user/UserRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,11 @@ export class UserRepository {
* @param user user data from backend
*/
private async updateSavedUser(user: APIClientUser): Promise<User> {
const localUserEntity = this.findUserById(generateQualifiedId(user)) ?? new User();
const localUserEntity = this.findUserById(generateQualifiedId(user));
if (!localUserEntity) {
// If the user could not be found locally, we will get it and save it locally
return this.getUserById(user.qualified_id);
}
const updatedUser = this.userMapper.updateUserFromObject(localUserEntity, user, this.userState.self().domain);
const {qualifiedId: userId} = updatedUser;

Expand Down

0 comments on commit 2979a63

Please sign in to comment.