feat: almost abstractions

This commit is contained in:
2024-07-19 15:06:35 +03:00
parent 00213d25a1
commit 7b2c6d9fc8
4 changed files with 18 additions and 8 deletions

View File

@@ -56,6 +56,7 @@ export class DetailComponent implements AfterViewInit, OnDestroy {
this.route.queryParams.pipe(takeUntil(this.destroy$)).subscribe((params) => {
const url = params["url"];
if (url) {
this.searchService.setMangalibParser();
this.getDetails(url);
} else {
this.router.navigate(["/"]);

View File

@@ -33,6 +33,7 @@ export class HomeComponent implements OnDestroy, OnInit {
this.route.queryParams.subscribe((params) => {
const search = params["search"];
if (search) {
this.searchService.setMangalibParser();
this.loading = true;
this.searchService
.search(search)

View File

@@ -24,7 +24,6 @@ import { CachedPage, CachedPages } from "./reader.dto";
imports: [CommonModule, ScaleImageComponent, RouterLink],
})
export class ReaderComponent implements OnInit, OnDestroy {
//FIXME: Scrolling to top when manhwa
pages: Page[] = [];
currentPageIndex = 0;
cachedPages: CachedPages = new Map<number, CachedPage>();
@@ -61,6 +60,7 @@ export class ReaderComponent implements OnInit, OnDestroy {
const volume = params["volume"];
const fromTowards = params["from_towards"];
if (url && chapter && volume) {
this.searchService.setMangalibParser();
if (fromTowards) this.fromTowards = Boolean(+fromTowards);
else this.fromTowards = false;
this.chapterNum = +chapter;