From d5508872dd0f6dd96cf5f1216a040831e19fc9e4 Mon Sep 17 00:00:00 2001 From: natsoni Date: Fri, 31 May 2024 15:08:58 +0200 Subject: [PATCH] Select lightning node by default in search results of public key --- .../search-form/search-results/search-results.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/app/components/search-form/search-results/search-results.component.ts b/frontend/src/app/components/search-form/search-results/search-results.component.ts index 082f24b13..04976028b 100644 --- a/frontend/src/app/components/search-form/search-results/search-results.component.ts +++ b/frontend/src/app/components/search-form/search-results/search-results.component.ts @@ -28,6 +28,10 @@ export class SearchResultsComponent implements OnChanges { this.activeIdx = 0; if (this.results) { this.resultsFlattened = [...(this.results.hashQuickMatch ? [this.results.searchText] : []), ...this.results.addresses, ...this.results.pools, ...this.results.nodes, ...this.results.channels, ...this.results.otherNetworks]; + // If searchText is a public key corresponding to a node, select it by default + if (this.results.publicKey && this.results.nodes.length > 0) { + this.activeIdx = 1; + } } }