mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 10:21:52 +01:00
Merge pull request #812 from mempool/simon/liquid-block-hash-search-fix
Handle search for Liquid block hashes in search bar.
This commit is contained in:
commit
1f8ec2bd8e
@ -107,7 +107,12 @@ export class SearchFormComponent implements OnInit {
|
||||
this.electrsApiService.getAsset$(searchText)
|
||||
.subscribe(
|
||||
() => { this.navigate('/asset/', searchText); },
|
||||
() => { this.navigate('/tx/', searchText); }
|
||||
() => {
|
||||
this.electrsApiService.getBlock$(searchText)
|
||||
.subscribe(
|
||||
(block) => { this.navigate('/block/', searchText, { state: { data: { block } } }); },
|
||||
() => { this.navigate('/tx/', searchText); });
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.navigate('/tx/', searchText);
|
||||
@ -118,8 +123,8 @@ export class SearchFormComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
navigate(url: string, searchText: string) {
|
||||
this.router.navigate([(this.network && this.stateService.env.BASE_MODULE === 'mempool' ? '/' + this.network : '') + url, searchText]);
|
||||
navigate(url: string, searchText: string, extras?: any) {
|
||||
this.router.navigate([(this.network && this.stateService.env.BASE_MODULE === 'mempool' ? '/' + this.network : '') + url, searchText], extras);
|
||||
this.searchTriggered.emit();
|
||||
this.searchForm.setValue({
|
||||
searchText: '',
|
||||
|
Loading…
Reference in New Issue
Block a user