From b6470d1072118cd35e76294692f417c7addd079c Mon Sep 17 00:00:00 2001 From: Cuong-Tran Date: Tue, 7 Jan 2025 03:08:28 +0700 Subject: [PATCH] Fix: add entry to favorite when open from link on `UrlImportableSource` sources --- .../main/java/exh/ui/intercept/InterceptActivity.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/exh/ui/intercept/InterceptActivity.kt b/app/src/main/java/exh/ui/intercept/InterceptActivity.kt index d97d35a96..b9a2e6981 100644 --- a/app/src/main/java/exh/ui/intercept/InterceptActivity.kt +++ b/app/src/main/java/exh/ui/intercept/InterceptActivity.kt @@ -175,7 +175,7 @@ class InterceptActivity : BaseActivity() { private val galleryAdder = GalleryAdder() - suspend fun loadGallery(gallery: String) { + private suspend fun loadGallery(gallery: String) { // Do not load gallery if already loading if (status.value is InterceptResult.Idle) { status.value = InterceptResult.Loading @@ -199,7 +199,14 @@ class InterceptActivity : BaseActivity() { } private suspend fun loadGalleryEnd(gallery: String, source: UrlImportableSource? = null) { - val result = galleryAdder.addGallery(this@InterceptActivity, gallery, forceSource = source) + val result = galleryAdder.addGallery( + this@InterceptActivity, + gallery, + // KMK --> + fav = true, + // KMK <-- + forceSource = source, + ) status.value = when (result) { is GalleryAddEvent.Success -> InterceptResult.Success(result.manga.id, result.manga, result.chapter)