Fix channel map loading spinners
This commit is contained in:
@@ -93,6 +93,9 @@
|
||||
top: 50%;
|
||||
left: calc(50% - 15px);
|
||||
z-index: 100;
|
||||
@media (max-width: 767.98px) {
|
||||
top: 550px;
|
||||
}
|
||||
}
|
||||
.loading-spinner.widget {
|
||||
position: absolute;
|
||||
@@ -103,4 +106,22 @@
|
||||
@media (max-width: 767.98px) {
|
||||
top: 250px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.loading-spinner.nodepage {
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
z-index: 100;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.loading-spinner.channelpage {
|
||||
position: absolute;
|
||||
top: 400px;
|
||||
z-index: 100;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
@media (max-width: 767.98px) {
|
||||
top: 450px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ export class NodesChannelsMap implements OnInit {
|
||||
@Input() publicKey: string | undefined;
|
||||
@Input() channel: any[] = [];
|
||||
@Input() fitContainer = false;
|
||||
@Input() hasLocation = true;
|
||||
@Output() readyEvent = new EventEmitter();
|
||||
|
||||
channelsObservable: Observable<any>;
|
||||
@@ -32,7 +33,7 @@ export class NodesChannelsMap implements OnInit {
|
||||
channelColor = '#466d9d';
|
||||
channelCurve = 0;
|
||||
nodeSize = 4;
|
||||
isLoading = true;
|
||||
isLoading = false;
|
||||
|
||||
chartInstance = undefined;
|
||||
chartOptions: EChartsOption = {};
|
||||
@@ -73,6 +74,11 @@ export class NodesChannelsMap implements OnInit {
|
||||
this.channelsObservable = this.activatedRoute.paramMap
|
||||
.pipe(
|
||||
switchMap((params: ParamMap) => {
|
||||
this.isLoading = true;
|
||||
if (this.style === 'channelpage' && this.channel.length === 0 || !this.hasLocation) {
|
||||
this.isLoading = false;
|
||||
}
|
||||
|
||||
return zip(
|
||||
this.assetsService.getWorldMapJson$,
|
||||
this.style !== 'channelpage' ? this.apiService.getChannelsGeo$(params.get('public_key') ?? undefined, this.style) : [''],
|
||||
|
||||
Reference in New Issue
Block a user