From 1f2254681ae18ac7a75d0a3269d3ad0e21db4034 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 6 Jul 2022 16:21:14 +0200 Subject: [PATCH] Search result fix when Lightning not enabled --- .../src/app/components/search-form/search-form.component.ts | 6 ++++++ .../search-results/search-results.component.html | 2 +- .../search-form/search-results/search-results.component.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/search-form/search-form.component.ts b/frontend/src/app/components/search-form/search-form.component.ts index 55279ca05..9ed40700a 100644 --- a/frontend/src/app/components/search-form/search-form.component.ts +++ b/frontend/src/app/components/search-form/search-form.component.ts @@ -80,6 +80,12 @@ export class SearchFormComponent implements OnInit { } ]); } + if (!this.stateService.env.LIGHTNING) { + return zip( + this.electrsApiService.getAddressesByPrefix$(text).pipe(catchError(() => of([]))), + [{ nodes: [], channels: [] }] + ); + } return zip( this.electrsApiService.getAddressesByPrefix$(text).pipe(catchError(() => of([]))), this.apiService.lightningSearch$(text).pipe(catchError(() => of({ diff --git a/frontend/src/app/components/search-form/search-results/search-results.component.html b/frontend/src/app/components/search-form/search-results/search-results.component.html index 8c18b1565..f7193f261 100644 --- a/frontend/src/app/components/search-form/search-results/search-results.component.html +++ b/frontend/src/app/components/search-form/search-results/search-results.component.html @@ -1,6 +1,6 @@