fix: manhwa scroll unloading pages

This commit is contained in:
2024-07-18 16:51:30 +03:00
parent 5465d1635c
commit 00213d25a1
2 changed files with 3 additions and 1 deletions

View File

@@ -166,7 +166,9 @@ export class ReaderComponent implements OnInit, OnDestroy {
private clearCache(index: number) { private clearCache(index: number) {
for (let i = 0; i <= index; i++) { for (let i = 0; i <= index; i++) {
const imgUrl = this.cachedPages.get(i)!.imageUrl;
this.cachedPages.get(i)!.imageUrl = ""; this.cachedPages.get(i)!.imageUrl = "";
URL.revokeObjectURL(imgUrl);
} }
} }

View File

@@ -34,7 +34,7 @@ export class ScaleImageComponent implements AfterViewInit, OnDestroy {
([entry]) => entry.isIntersecting && this.view.emit(), ([entry]) => entry.isIntersecting && this.view.emit(),
{ {
root: this.hostScrollable ? this.host.nativeElement : null, root: this.hostScrollable ? this.host.nativeElement : null,
rootMargin: "700px", rootMargin: "100px",
}, },
); );
if (this.containerRef) this.observer.observe(this.containerRef.nativeElement); if (this.containerRef) this.observer.observe(this.containerRef.nativeElement);