Skip to content

Commit

Permalink
Merge pull request primefaces#138 from atretyak1985/issue_#136
Browse files Browse the repository at this point in the history
Labels not updating immediately primefaces#136
  • Loading branch information
Alfred Hall authored Feb 25, 2019
2 parents 6386dcb + 57b7417 commit 419fc1a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/organization/device/device_list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ export class DeviceListComponent implements OnInit {
});

this.labelService.listResponse$.subscribe((p: any) => {
this.labelApplyForm = new FormGroup({});
this.labels = p.items as ApplyLabelListItem[];
for(let label of this.labels) {
this.labelApplyForm.addControl(label.name, new FormControl());
}
});
this.labelService.getLabels();
}

ngAfterViewChecked() {
Expand Down Expand Up @@ -194,7 +194,7 @@ export class DeviceListComponent implements OnInit {

this.ptable.first = 0;

this.customReuseStrategyService.routeReused$.subscribe((d: any) => {
let subscribeFunction = (d: any) => {
if(this.route.snapshot.url == d.url) {
this.selectedId = this.route.snapshot.queryParams['id'];
if(this.selectedId) {
Expand All @@ -214,13 +214,18 @@ export class DeviceListComponent implements OnInit {
this.savedScrollPos = 0;
}, 50);
}

this.labelService.getLabels();
} else {
let scrollPos = this.ptable.getScrollPosition();
if (scrollPos > 0) {
this.savedScrollPos = scrollPos;
}
}
});
};

subscribeFunction({url: this.route.snapshot.url});
this.customReuseStrategyService.routeReused$.subscribe(subscribeFunction);

this.badgeContainers.changes.subscribe(() => {
this.determineBadges();
Expand Down

0 comments on commit 419fc1a

Please sign in to comment.