Search fix. Channel update.

This commit is contained in:
softsimon
2022-05-26 18:23:57 +04:00
parent b87308e14f
commit f0ad38dec6
5 changed files with 14 additions and 6 deletions

View File

@@ -111,7 +111,7 @@ export class SearchFormComponent implements OnInit {
selectedResult(result: any) {
if (typeof result === 'string') {
this.navigate('/address/', result);
this.search();
} else if (result.alias) {
this.navigate('/lightning/node/', result.public_key);
} else if (result.short_id) {

View File

@@ -36,7 +36,11 @@ export class SearchResultsComponent implements OnChanges {
break;
case 'Enter':
event.preventDefault();
this.selectedResult.emit(this.resultsFlattened[this.activeIdx]);
if (this.resultsFlattened[this.activeIdx]) {
this.selectedResult.emit(this.resultsFlattened[this.activeIdx]);
} else {
this.selectedResult.emit(this.searchTerm);
}
this.results = null;
break;
}

View File

@@ -1,6 +1,6 @@
<div class="mb-2 box-top">
<div class="box-left">
<h2 class="mb-0">{{ channel.alias || '?' }}</h2>
<h3 class="mb-0">{{ channel.alias || '?' }}</h3>
<a [routerLink]="['/lightning/node' | relativeUrl, channel.public_key]" >
{{ channel.public_key | shortenString : 12 }}
</a>

View File

@@ -7,10 +7,14 @@ import { WebsocketService } from 'src/app/services/websocket.service';
styleUrls: ['./lightning-wrapper.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LightningWrapperComponent {
export class LightningWrapperComponent implements OnInit {
constructor(
private websocketService: WebsocketService,
) { }
ngOnInit() {
this.websocketService.want(['blocks']);
}
}