1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-22 03:03:22 +00:00

handle group syncs even whenever there are no users

This commit is contained in:
Kyle Spearrin
2018-05-08 15:11:16 -04:00
parent 9644d95b9b
commit 445c3f220a
2 changed files with 7 additions and 8 deletions

View File

@@ -139,18 +139,17 @@ export class DashboardComponent implements OnInit, OnDestroy {
continue; continue;
} }
const anyG = (g as any);
anyG.users = [];
for (const uid of g.userMemberExternalIds) { for (const uid of g.userMemberExternalIds) {
if (userMap.has(uid)) { if (userMap.has(uid)) {
if ((g as any).users == null) { anyG.users.push(userMap.get(uid));
(g as any).users = []; } else {
} anyG.users.push(uid);
(g as any).users.push(userMap.get(uid));
} }
} }
if ((g as any).users != null) { this.sort(anyG.users);
this.sort((g as any).users);
}
} }
} }
resolve(); resolve();

View File

@@ -60,7 +60,7 @@ export class SyncService {
this.flattenUsersToGroups(groups, groups); this.flattenUsersToGroups(groups, groups);
} }
if (test || groups == null || groups.length === 0 || users == null || users.length === 0) { if (test || ((groups == null || groups.length === 0) && (users == null || users.length === 0))) {
if (!test) { if (!test) {
await this.saveSyncTimes(syncConfig, now); await this.saveSyncTimes(syncConfig, now);
} }