From 1247d4e466e87f6d8dfce0e07d87a35c66ef7505 Mon Sep 17 00:00:00 2001 From: Cuong-Tran Date: Mon, 17 Feb 2025 14:37:09 +0700 Subject: [PATCH] Fix (BrowseSourceScreen): don't expand manga description if it's favorited --- .../ui/browse/source/browse/BrowseSourceScreen.kt | 6 +++--- .../eu/kanade/tachiyomi/ui/manga/MangaScreen.kt | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt index b9582ca91..231c767a0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt @@ -344,13 +344,13 @@ data class BrowseSourceScreen( // KMK <-- navigator.push( MangaScreen( - manga.id, + mangaId = manga.id, // KMK --> // Finding the entry to be merged to, so we don't want to expand description // so that user can see the `Merge to another` button - smartSearchConfig != null, + fromSource = smartSearchConfig == null, // KMK <-- - smartSearchConfig, + smartSearchConfig = smartSearchConfig, ), ) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt index f9e3ed1c2..b665dcb61 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt @@ -117,7 +117,11 @@ import uy.kohesive.injekt.api.get class MangaScreen( private val mangaId: Long, - /** If it is opened from Source then it will auto expand the manga description */ + /** + * If it is opened from Source then it will auto expand the manga description. + * - `true`: Expand description if it's not favorited + * - `false`: Don't expand description + */ val fromSource: Boolean = false, private val smartSearchConfig: SourcesScreen.SmartSearchConfig? = null, ) : Screen(), AssistContentScreen { @@ -138,7 +142,13 @@ class MangaScreen( val scope = rememberCoroutineScope() val lifecycleOwner = LocalLifecycleOwner.current val screenModel = rememberScreenModel { - MangaScreenModel(context, lifecycleOwner.lifecycle, mangaId, fromSource, smartSearchConfig != null) + MangaScreenModel( + context = context, + lifecycle = lifecycleOwner.lifecycle, + mangaId = mangaId, + isFromSource = fromSource, + smartSearched = smartSearchConfig != null, + ) } val state by screenModel.state.collectAsStateWithLifecycle()