From 594777960b77a1dbe667a39c6b67cb4d3ceea330 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 31 Aug 2020 12:14:56 +0200 Subject: [PATCH] Adjust code style in user repo Cleans up return statements in void functions --- .../core/repositories/users/user-repository.service.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/src/app/core/repositories/users/user-repository.service.ts b/client/src/app/core/repositories/users/user-repository.service.ts index 6fdbdafb7..00364c10e 100644 --- a/client/src/app/core/repositories/users/user-repository.service.ts +++ b/client/src/app/core/repositories/users/user-repository.service.ts @@ -500,20 +500,17 @@ export class UserRepositoryService extends BaseRepository user.id).intersect(this.demoModeUserIds).length > 0) { + if (this.demoModeUserIds && users.map(user => user.id).intersect(this.demoModeUserIds).length > 0) { this.preventInDemo(); } - } else if (this.demoModeUserIds.some(userId => userId === users.id)) { + } else if (this.demoModeUserIds?.some(userId => userId === users.id)) { this.preventInDemo(); } } private preventInDemo(): void { - if (this.demoModeUserIds) { + if (this.demoModeUserIds && this.demoModeUserIds.length) { throw new PreventedInDemo(); } }