1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

sim fixes

This commit is contained in:
Kyle Spearrin
2018-05-02 16:36:47 -04:00
parent 5e2895ce33
commit c80fa93515
2 changed files with 10 additions and 4 deletions

View File

@@ -15,8 +15,8 @@
Simulate
</button>
<div class="form-check mt-2">
<input class="form-check-input" type="checkbox" id="sinceLast" [(ngModel)]="sinceLast">
<label class="form-check-label" for="sinceLast">Since the last successful sync</label>
<input class="form-check-input" type="checkbox" id="simSinceLast" [(ngModel)]="simSinceLast">
<label class="form-check-label" for="simSinceLast">Since the last successful sync</label>
</div>
<ng-container *ngIf="!simBtn.loading && (simUsers || simGroups)">
<hr />

View File

@@ -21,8 +21,8 @@ export class DashboardComponent {
simDisabledUsers: UserEntry[] = [];
simDeletedUsers: UserEntry[] = [];
simPromise: Promise<any>;
simSinceLast: boolean = false;
syncPromise: Promise<any>;
sinceLast: boolean = false;
constructor(private i18nService: I18nService, private syncService: SyncService) { }
@@ -32,9 +32,15 @@ export class DashboardComponent {
}
async simulate() {
this.simGroups = null;
this.simUsers = null;
this.simEnabledUsers = [];
this.simDisabledUsers = [];
this.simDeletedUsers = [];
this.simPromise = new Promise(async (resolve, reject) => {
try {
const result = await this.syncService.sync(!this.sinceLast, false);
const result = await this.syncService.sync(!this.simSinceLast, false);
this.simUsers = result[1];
this.simGroups = result[0];
} catch (e) {