-
{{title}}
+
{{title}} (Incognito Mode)
{{subtitle}}
diff --git a/UI/Web/src/app/manga-reader/manga-reader.component.ts b/UI/Web/src/app/manga-reader/manga-reader.component.ts
index 8e6d8c9b3..42fc7777c 100644
--- a/UI/Web/src/app/manga-reader/manga-reader.component.ts
+++ b/UI/Web/src/app/manga-reader/manga-reader.component.ts
@@ -66,6 +66,11 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
volumeId!: number;
chapterId!: number;
+ /**
+ * If this is true, no progress will be saved.
+ */
+ incognitoMode: boolean = false;
+
/**
* The current page. UI will show this number + 1.
*/
@@ -259,6 +264,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.libraryId = parseInt(libraryId, 10);
this.seriesId = parseInt(seriesId, 10);
this.chapterId = parseInt(chapterId, 10);
+ this.incognitoMode = this.route.snapshot.queryParamMap.get('incognitoMode') === 'true';
this.continuousChaptersStack.push(this.chapterId);
@@ -706,7 +712,10 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.continuousChaptersStack.push(chapterId);
// Load chapter Id onto route but don't reload
const lastSlashIndex = this.router.url.lastIndexOf('/');
- const newRoute = this.router.url.substring(0, lastSlashIndex + 1) + this.chapterId + '';
+ let newRoute = this.router.url.substring(0, lastSlashIndex + 1) + this.chapterId + '';
+ if (this.incognitoMode) {
+ newRoute += '?incognitoMode=true';
+ }
window.history.replaceState({}, '', newRoute);
this.init();
} else {
@@ -777,8 +786,9 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
pageNum = this.pageNum + 1;
}
-
- this.readerService.saveProgress(this.seriesId, this.volumeId, this.chapterId, pageNum).pipe(take(1)).subscribe(() => {/* No operation */});
+ if (!this.incognitoMode) {
+ this.readerService.saveProgress(this.seriesId, this.volumeId, this.chapterId, pageNum).pipe(take(1)).subscribe(() => {/* No operation */});
+ }
this.isLoading = true;
this.canvasImage = this.cachedImages.current();
@@ -929,6 +939,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
handleWebtoonPageChange(updatedPageNum: number) {
this.setPageNum(updatedPageNum);
+ if (this.incognitoMode) return;
this.readerService.saveProgress(this.seriesId, this.volumeId, this.chapterId, this.pageNum).pipe(take(1)).subscribe(() => {/* No operation */});
}
diff --git a/UI/Web/src/app/series-detail/series-detail.component.ts b/UI/Web/src/app/series-detail/series-detail.component.ts
index 56b562fec..969f6f3e9 100644
--- a/UI/Web/src/app/series-detail/series-detail.component.ts
+++ b/UI/Web/src/app/series-detail/series-detail.component.ts
@@ -175,6 +175,11 @@ export class SeriesDetailComponent implements OnInit {
case(Action.Edit):
this.openViewInfo(volume);
break;
+ case(Action.IncognitoRead):
+ if (volume.chapters != undefined && volume.chapters?.length >= 1) {
+ this.openChapter(volume.chapters[0], true);
+ }
+ break;
default:
break;
}
@@ -191,6 +196,9 @@ export class SeriesDetailComponent implements OnInit {
case(Action.Edit):
this.openViewInfo(chapter);
break;
+ case(Action.IncognitoRead):
+ this.openChapter(chapter, true);
+ break;
default:
break;
}
@@ -348,16 +356,16 @@ export class SeriesDetailComponent implements OnInit {
});
}
- openChapter(chapter: Chapter) {
+ openChapter(chapter: Chapter, incognitoMode = false) {
if (chapter.pages === 0) {
this.toastr.error('There are no pages. Kavita was not able to read this archive.');
return;
}
if (chapter.files.length > 0 && chapter.files[0].format === MangaFormat.EPUB) {
- this.router.navigate(['library', this.libraryId, 'series', this.series?.id, 'book', chapter.id]);
+ this.router.navigate(['library', this.libraryId, 'series', this.series?.id, 'book', chapter.id], {queryParams: {incognitoMode}});
} else {
- this.router.navigate(['library', this.libraryId, 'series', this.series?.id, 'manga', chapter.id]);
+ this.router.navigate(['library', this.libraryId, 'series', this.series?.id, 'manga', chapter.id], {queryParams: {incognitoMode}});
}
}