ing
This commit is contained in:
parent
ad6907f7ba
commit
378c65c514
|
@ -18,10 +18,10 @@ import { PageParams } from '@overflow/commons-typescript/model/commons/PageParam
|
|||
templateUrl: './sensor-list.component.html',
|
||||
})
|
||||
export class SensorListComponent implements OnInit, OnChanges {
|
||||
@Input() pageNo: number;
|
||||
@Output() select = new EventEmitter<Sensor>();
|
||||
@Output() addSensor = new EventEmitter();
|
||||
|
||||
pageNo = 1;
|
||||
page: Page<Sensor>;
|
||||
pending$: Observable<boolean>;
|
||||
error$: Observable<any>;
|
||||
|
@ -37,10 +37,6 @@ export class SensorListComponent implements OnInit, OnChanges {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (undefined === this.pageNo || 1 > this.pageNo) {
|
||||
this.pageNo = 0;
|
||||
}
|
||||
|
||||
this.store.pipe(
|
||||
tap(() => {
|
||||
this.pending$ = of(true);
|
||||
|
@ -48,7 +44,7 @@ export class SensorListComponent implements OnInit, OnChanges {
|
|||
select(AuthSelector.selectDomainMember),
|
||||
exhaustMap((domainMember: DomainMember) => {
|
||||
const pageParams: PageParams = {
|
||||
pageNo: this.pageNo,
|
||||
pageNo: this.pageNo - 1,
|
||||
countPerPage: 10,
|
||||
sortCol: 'id',
|
||||
sortDirection: 'descending',
|
||||
|
@ -58,6 +54,7 @@ export class SensorListComponent implements OnInit, OnChanges {
|
|||
.pipe(
|
||||
map((page: Page<Sensor>) => {
|
||||
this.page = page;
|
||||
this.generateSensorMap();
|
||||
}),
|
||||
catchError(error => {
|
||||
this.error$ = of(error);
|
||||
|
|
Loading…
Reference in New Issue
Block a user