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 });
|
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 {
|
try {
|
||||||
@ -72,11 +79,6 @@ export class AppComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
// TODO do something to halt user progress...show a sad cicada page 🦗?
|
// 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) {
|
if (!this.swUpdate.isEnabled) {
|
||||||
this.swUpdate.available.subscribe(() => {
|
this.swUpdate.available.subscribe(() => {
|
||||||
if (confirm('New Version available. Load New Version?')) {
|
if (confirm('New Version available. Load New Version?')) {
|
||||||
|
@ -29,6 +29,11 @@ export class TokensComponent implements OnInit, AfterViewInit {
|
|||||||
constructor(private tokenService: TokenService) {}
|
constructor(private tokenService: TokenService) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.tokenService.load.subscribe(async (status: boolean) => {
|
||||||
|
if (status) {
|
||||||
|
await this.tokenService.getTokens();
|
||||||
|
}
|
||||||
|
});
|
||||||
this.tokenService.tokensSubject.subscribe((tokens) => {
|
this.tokenService.tokensSubject.subscribe((tokens) => {
|
||||||
this.dataSource = new MatTableDataSource(tokens);
|
this.dataSource = new MatTableDataSource(tokens);
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
@ -38,8 +43,10 @@ export class TokensComponent implements OnInit, AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.dataSource.paginator = this.paginator;
|
if (this.dataSource) {
|
||||||
this.dataSource.sort = this.sort;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
this.dataSource.sort = this.sort;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doFilter(value: string): void {
|
doFilter(value: string): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user