mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 14:52:03 +01:00
Fix default category showing if nothing is in it
This commit is contained in:
@@ -9,4 +9,7 @@ fragment CategoryFragment on CategoryType {
|
||||
key
|
||||
value
|
||||
}
|
||||
mangas {
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,9 @@ class CategoryRepositoryImpl(
|
||||
.toFlow()
|
||||
.map {
|
||||
val data = it.dataAssertNoErrors
|
||||
data.categories.nodes.map { it.categoryFragment.toCategory() }
|
||||
data.categories.nodes
|
||||
.filterNot { it.categoryFragment.id == 0 && it.categoryFragment.mangas.totalCount == 0 }
|
||||
.map { it.categoryFragment.toCategory() }
|
||||
}
|
||||
|
||||
override fun createCategory(name: String): Flow<Unit> =
|
||||
|
||||
@@ -8,7 +8,6 @@ package ca.gosyer.jui.ui.reader
|
||||
|
||||
import ca.gosyer.jui.core.lang.launchDefault
|
||||
import ca.gosyer.jui.core.prefs.getAsFlow
|
||||
import ca.gosyer.jui.domain.chapter.interactor.GetChapter
|
||||
import ca.gosyer.jui.domain.chapter.interactor.GetChapterPages
|
||||
import ca.gosyer.jui.domain.chapter.interactor.GetChapters
|
||||
import ca.gosyer.jui.domain.chapter.interactor.UpdateChapter
|
||||
@@ -36,6 +35,7 @@ import ca.gosyer.jui.ui.reader.model.ReaderPageSeparator
|
||||
import ca.gosyer.jui.ui.reader.model.ViewerChapters
|
||||
import ca.gosyer.jui.uicore.vm.ContextWrapper
|
||||
import ca.gosyer.jui.uicore.vm.ViewModel
|
||||
import com.diamondedge.logging.logging
|
||||
import io.ktor.http.decodeURLQueryComponent
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
@@ -66,14 +66,12 @@ import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import me.tatarka.inject.annotations.Assisted
|
||||
import me.tatarka.inject.annotations.Inject
|
||||
import com.diamondedge.logging.logging
|
||||
|
||||
@Inject
|
||||
class ReaderMenuViewModel(
|
||||
private val readerPreferences: ReaderPreferences,
|
||||
private val getManga: GetManga,
|
||||
private val getChapters: GetChapters,
|
||||
private val getChapter: GetChapter,
|
||||
private val getChapterPages: GetChapterPages,
|
||||
private val updateChapter: UpdateChapter,
|
||||
private val updateMangaMeta: UpdateMangaMeta,
|
||||
|
||||
Reference in New Issue
Block a user