Skip to content

Commit

Permalink
Added only loading pages when the tab is shown [#646]
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpierce committed Jun 26, 2021
1 parent 529a9fb commit 3c8c219
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -118,6 +118,7 @@
</mat-tab>
<mat-tab [label]="'comic-book.label.comic-pages' | translate">
<cx-comic-pages
*ngIf="showPages"
[comic]="comic"
[pageSize]="pageSize"
></cx-comic-pages>
Expand Down
Expand Up @@ -91,6 +91,7 @@ export class ComicBookPageComponent
lastReadDates: LastRead[] = [];
isRead = false;
lastRead: LastRead = null;
showPages = false;

constructor(
private logger: LoggerService,
Expand All @@ -114,6 +115,7 @@ export class ComicBookPageComponent
params => {
if (+params[QUERY_PARAM_TAB]) {
this.currentTab = +params[QUERY_PARAM_TAB];
this.updateShowPages();
}
}
);
Expand Down Expand Up @@ -204,6 +206,11 @@ export class ComicBookPageComponent
QUERY_PARAM_TAB,
`${index}`
);
this.updateShowPages();
}

private updateShowPages(): void {
this.showPages = this.showPages || this.currentTab === 2;
}

onLoadScrapingVolumes(
Expand Down

0 comments on commit 3c8c219

Please sign in to comment.