From 77835bcb9d1d643f70004a4da738a7551fcebae6 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 22 Mar 2023 13:20:22 +0900 Subject: [PATCH] Restoring Preview component behavior --- .../nodes-channels-map.component.ts | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts index 5fce18c4e..bf4117b30 100644 --- a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts +++ b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts @@ -204,19 +204,33 @@ export class NodesChannelsMap implements OnInit { prepareChartOptions(nodes, channels) { let title: object; - if (channels.length === 0 && !this.placeholder) { - this.isLoading = false; - title = { - textStyle: { - color: 'white', - fontSize: 18 - }, - text: $localize`No data to display yet. Try again later.`, - left: 'center', - top: 'center' - }; - this.zoom = 1.5; - this.center = [0, 20]; + if (channels.length === 0) { + if (!this.placeholder) { + this.isLoading = false; + title = { + textStyle: { + color: 'white', + fontSize: 18 + }, + text: $localize`No data to display yet. Try again later.`, + left: 'center', + top: 'center' + }; + this.zoom = 1.5; + this.center = [0, 20]; + } else { // used for Node and Channel preview components + title = { + textStyle: { + color: 'white', + fontSize: 18 + }, + text: $localize`No geolocation data available`, + left: 'center', + top: 'center' + }; + this.zoom = 1.5; + this.center = [0, 20]; + } } this.chartOptions = {