From 445c3f220af03f9581050c9dfde66c0c5e519983 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 8 May 2018 15:11:16 -0400 Subject: [PATCH] handle group syncs even whenever there are no users --- src/app/tabs/dashboard.component.ts | 13 ++++++------- src/services/sync.service.ts | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/app/tabs/dashboard.component.ts b/src/app/tabs/dashboard.component.ts index c07ad2fb..39a18002 100644 --- a/src/app/tabs/dashboard.component.ts +++ b/src/app/tabs/dashboard.component.ts @@ -139,18 +139,17 @@ export class DashboardComponent implements OnInit, OnDestroy { continue; } + const anyG = (g as any); + anyG.users = []; for (const uid of g.userMemberExternalIds) { if (userMap.has(uid)) { - if ((g as any).users == null) { - (g as any).users = []; - } - (g as any).users.push(userMap.get(uid)); + anyG.users.push(userMap.get(uid)); + } else { + anyG.users.push(uid); } } - if ((g as any).users != null) { - this.sort((g as any).users); - } + this.sort(anyG.users); } } resolve(); diff --git a/src/services/sync.service.ts b/src/services/sync.service.ts index a163f190..563c3693 100644 --- a/src/services/sync.service.ts +++ b/src/services/sync.service.ts @@ -60,7 +60,7 @@ export class SyncService { 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) { await this.saveSyncTimes(syncConfig, now); }