From 82a0ba102d0763bd128c6e399aa2c19f6c8f575e Mon Sep 17 00:00:00 2001 From: Sergey Elpashev Date: Wed, 10 Jul 2024 16:51:26 +0300 Subject: [PATCH] feat: error in reader without auth --- .../app/components/auth/auth.component.less | 3 --- .../app/components/reader/reader.component.ts | 20 ++++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/apps/NwaifuAnime/src/app/components/auth/auth.component.less b/apps/NwaifuAnime/src/app/components/auth/auth.component.less index fa58d9d..e69de29 100644 --- a/apps/NwaifuAnime/src/app/components/auth/auth.component.less +++ b/apps/NwaifuAnime/src/app/components/auth/auth.component.less @@ -1,3 +0,0 @@ -.tamperMonkey { - display: none; -} diff --git a/apps/NwaifuAnime/src/app/components/reader/reader.component.ts b/apps/NwaifuAnime/src/app/components/reader/reader.component.ts index 73709f5..932d525 100644 --- a/apps/NwaifuAnime/src/app/components/reader/reader.component.ts +++ b/apps/NwaifuAnime/src/app/components/reader/reader.component.ts @@ -72,13 +72,19 @@ export class ReaderComponent implements AfterViewInit, OnDestroy { this.searchService .getChapter(url, chapter, volume) .pipe(takeUntil(this.destroy$)) - .subscribe((data) => { - this.currentChapterInfo = data.data; - this.pages = data.data.pages; - if (this.fromTowards) { - this.currentPageIndex = this.pages.length - 1; - this.loadPage(this.pages.length - 1); // Загрузить последнюю страницу при открытии главы - } else this.loadPage(0); // Загрузить первую страницу при открытии главы + .subscribe({ + next: (data) => { + this.currentChapterInfo = data.data; + this.pages = data.data.pages; + if (this.fromTowards) { + this.currentPageIndex = this.pages.length - 1; + this.loadPage(this.pages.length - 1); // Загрузить последнюю страницу при открытии главы + } else this.loadPage(0); // Загрузить первую страницу при открытии главы + }, + error: (error) => { + console.log(error); + this.router.navigate(["/", "detail"], { queryParams: { url: this.url } }); + }, }); }