[lightning] fix js error when there is no geolocation available

This commit is contained in:
nymkappa 2023-09-18 09:44:22 +02:00
parent 47dd2cbd5d
commit e79c32010d
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 6 additions and 1 deletions

View File

@ -114,7 +114,7 @@ export class NodesMap implements OnInit, OnChanges {
node[3], // Alias node[3], // Alias
node[2], // Public key node[2], // Public key
node[5], // Channels node[5], // Channels
node[6].en, // Country node[6]?.en, // Country
node[7], // ISO Code node[7], // ISO Code
]); ]);
} }

View File

@ -20,6 +20,11 @@ export class GeolocationComponent implements OnChanges {
formattedLocation: string = ''; formattedLocation: string = '';
ngOnChanges(): void { ngOnChanges(): void {
if (!this.data) {
this.formattedLocation = '-';
return;
}
const city = this.data.city ? this.data.city : ''; const city = this.data.city ? this.data.city : '';
const subdivisionLikeCity = this.data.city === this.data.subdivision; const subdivisionLikeCity = this.data.city === this.data.subdivision;
let subdivision = this.data.subdivision; let subdivision = this.data.subdivision;