Skip to content

Commit 8d6bfd9

Browse files
committed
set default value for usertype in UserMapper.ts
1 parent 08ecb0f commit 8d6bfd9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

apps/webapp/src/script/repositories/user/UserMapper.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import {isSelfAPIUser} from './UserGuards';
2727
import type {ServerTimeHandler} from '../../time/serverTimeHandler';
2828
import '../../view_model/bindings/CommonBindings';
2929

30+
import {UserType} from '@wireapp/api-client/lib/user';
31+
3032
export class UserMapper {
3133
private readonly logger: Logger;
3234

@@ -183,9 +185,7 @@ export class UserMapper {
183185
userEntity.isDeleted = true;
184186
}
185187

186-
if (type) {
187-
userEntity.type = type;
188-
}
188+
userEntity.type = type ?? UserType.REGULAR;
189189

190190
if (app) {
191191
userEntity.description = app.description;
@@ -194,9 +194,6 @@ export class UserMapper {
194194
userEntity.description = undefined;
195195
userEntity.category = undefined;
196196
}
197-
userEntity.description = app.description;
198-
userEntity.category = app.category;
199-
}
200197

201198
return userEntity;
202199
}

0 commit comments

Comments
 (0)