Select lightning node by default in search results of public key

This commit is contained in:
natsoni 2024-05-31 15:08:58 +02:00
parent 321181d708
commit d5508872dd
No known key found for this signature in database
GPG Key ID: C65917583181743B

View File

@ -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;
}
}
}