Fix: add entry to favorite when open from link on UrlImportableSource sources

This commit is contained in:
Cuong-Tran 2025-01-07 03:08:28 +07:00
parent f37a7b1580
commit b6470d1072
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -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)