Fix loading state in blocks table issue
This commit is contained in:
parent
fc8f8abc7e
commit
7b6246a035
@ -85,15 +85,16 @@ export class BlocksList implements OnInit {
|
|||||||
this.keyNavigationSubscription = this.stateService.keyNavigation$
|
this.keyNavigationSubscription = this.stateService.keyNavigation$
|
||||||
.pipe(
|
.pipe(
|
||||||
tap((event) => {
|
tap((event) => {
|
||||||
this.isLoading = true;
|
|
||||||
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
|
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
|
||||||
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
|
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
|
||||||
if (event.key === prevKey && this.page > 1) {
|
if (event.key === prevKey && this.page > 1) {
|
||||||
this.page--;
|
this.page--;
|
||||||
|
this.isLoading = true;
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
}
|
}
|
||||||
if (event.key === nextKey && this.page * 15 < this.blocksCount) {
|
if (event.key === nextKey && this.page * 15 < this.blocksCount) {
|
||||||
this.page++;
|
this.page++;
|
||||||
|
this.isLoading = true;
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@ -118,6 +119,7 @@ export class BlocksList implements OnInit {
|
|||||||
if (this.blocksCount === undefined) {
|
if (this.blocksCount === undefined) {
|
||||||
this.blocksCount = blocks[0].height + 1;
|
this.blocksCount = blocks[0].height + 1;
|
||||||
this.blocksCountInitialized$.next(true);
|
this.blocksCountInitialized$.next(true);
|
||||||
|
this.blocksCountInitialized$.complete();
|
||||||
}
|
}
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
this.lastBlockHeight = Math.max(...blocks.map(o => o.height));
|
this.lastBlockHeight = Math.max(...blocks.map(o => o.height));
|
||||||
|
@ -76,15 +76,16 @@ export class RecentPegsListComponent implements OnInit {
|
|||||||
this.keyNavigationSubscription = this.stateService.keyNavigation$
|
this.keyNavigationSubscription = this.stateService.keyNavigation$
|
||||||
.pipe(
|
.pipe(
|
||||||
tap((event) => {
|
tap((event) => {
|
||||||
this.isLoading = true;
|
|
||||||
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
|
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
|
||||||
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
|
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
|
||||||
if (event.key === prevKey && this.page > 1) {
|
if (event.key === prevKey && this.page > 1) {
|
||||||
this.page--;
|
this.page--;
|
||||||
|
this.isLoading = true;
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
}
|
}
|
||||||
if (event.key === nextKey && this.page < this.pegsCount / this.pageSize) {
|
if (event.key === nextKey && this.page < this.pegsCount / this.pageSize) {
|
||||||
this.page++;
|
this.page++;
|
||||||
|
this.isLoading = true;
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user