Check for token route before loading tokens in app component.
This commit is contained in:
parent
0ba5b74856
commit
617741e7a9
@ -60,6 +60,13 @@ export class AppComponent implements OnInit {
|
||||
this.loggingService.sendErrorLevelMessage('Failed to load accounts', this, { error });
|
||||
}
|
||||
}
|
||||
if (!this.url.includes('tokens')) {
|
||||
this.tokenService.load.subscribe(async (status: boolean) => {
|
||||
if (status) {
|
||||
await this.tokenService.getTokens();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
@ -72,11 +79,6 @@ export class AppComponent implements OnInit {
|
||||
});
|
||||
// TODO do something to halt user progress...show a sad cicada page 🦗?
|
||||
}
|
||||
this.tokenService.load.subscribe(async (status: boolean) => {
|
||||
if (status) {
|
||||
await this.tokenService.getTokens();
|
||||
}
|
||||
});
|
||||
if (!this.swUpdate.isEnabled) {
|
||||
this.swUpdate.available.subscribe(() => {
|
||||
if (confirm('New Version available. Load New Version?')) {
|
||||
|
@ -29,6 +29,11 @@ export class TokensComponent implements OnInit, AfterViewInit {
|
||||
constructor(private tokenService: TokenService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.tokenService.load.subscribe(async (status: boolean) => {
|
||||
if (status) {
|
||||
await this.tokenService.getTokens();
|
||||
}
|
||||
});
|
||||
this.tokenService.tokensSubject.subscribe((tokens) => {
|
||||
this.dataSource = new MatTableDataSource(tokens);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
@ -38,8 +43,10 @@ export class TokensComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
if (this.dataSource) {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
}
|
||||
|
||||
doFilter(value: string): void {
|
||||
|
Loading…
Reference in New Issue
Block a user