[search bar] add missing autofocus on lightning dashboard

This commit is contained in:
nymkappa 2023-07-24 11:51:15 +09:00
parent da4a20cb85
commit 7db391d762
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { AfterViewChecked, ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { share } from 'rxjs/operators'; import { share } from 'rxjs/operators';
import { INodesRanking } from '../../interfaces/node-api.interface'; import { INodesRanking } from '../../interfaces/node-api.interface';
@ -12,7 +12,7 @@ import { LightningApiService } from '../lightning-api.service';
styleUrls: ['./lightning-dashboard.component.scss'], styleUrls: ['./lightning-dashboard.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class LightningDashboardComponent implements OnInit { export class LightningDashboardComponent implements OnInit, AfterViewChecked {
statistics$: Observable<any>; statistics$: Observable<any>;
nodesRanking$: Observable<INodesRanking>; nodesRanking$: Observable<INodesRanking>;
officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE; officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
@ -30,4 +30,7 @@ export class LightningDashboardComponent implements OnInit {
this.statistics$ = this.lightningApiService.getLatestStatistics$().pipe(share()); this.statistics$ = this.lightningApiService.getLatestStatistics$().pipe(share());
} }
ngAfterViewChecked(): void {
this.stateService.focusSearchInputDesktop();
}
} }