Fix kotlin-inject assisted warning

This commit is contained in:
Syer10
2023-02-13 16:29:11 -05:00
parent 2ef8be097e
commit 3b39b4e4bc
2 changed files with 7 additions and 3 deletions

View File

@@ -25,13 +25,16 @@ import kotlinx.coroutines.flow.runningFold
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import me.tatarka.inject.annotations.Assisted
import me.tatarka.inject.annotations.Inject
import org.lighthousegames.logging.logging
typealias GetMangaPage = @param:Assisted suspend (page: Int) -> MangaPage?
class SourcePager @Inject constructor(
private val getManga: GetManga,
private val serverListeners: ServerListeners,
private val fetcher: suspend (page: Int) -> MangaPage?
private val fetcher: GetMangaPage
) : CoroutineScope by CoroutineScope(Dispatchers.Default + SupervisorJob()) {
private val sourceMutex = Mutex()

View File

@@ -9,6 +9,7 @@ package ca.gosyer.jui.ui.sources.browse
import ca.gosyer.jui.domain.library.model.DisplayMode
import ca.gosyer.jui.domain.library.service.LibraryPreferences
import ca.gosyer.jui.domain.source.interactor.GetLatestManga
import ca.gosyer.jui.domain.source.interactor.GetMangaPage
import ca.gosyer.jui.domain.source.interactor.GetPopularManga
import ca.gosyer.jui.domain.source.interactor.GetSearchManga
import ca.gosyer.jui.domain.source.interactor.SourcePager
@@ -38,7 +39,7 @@ class SourceScreenViewModel(
private val getSearchManga: GetSearchManga,
private val catalogPreferences: CatalogPreferences,
private val libraryPreferences: LibraryPreferences,
private val getSourcePager: (suspend (page: Int) -> MangaPage?) -> SourcePager,
private val getSourcePager: (GetMangaPage) -> SourcePager,
contextWrapper: ContextWrapper,
private val savedStateHandle: SavedStateHandle,
initialQuery: String?
@@ -50,7 +51,7 @@ class SourceScreenViewModel(
getSearchManga: GetSearchManga,
catalogPreferences: CatalogPreferences,
libraryPreferences: LibraryPreferences,
getSourcePager: (suspend (page: Int) -> MangaPage?) -> SourcePager,
getSourcePager: (GetMangaPage) -> SourcePager,
contextWrapper: ContextWrapper,
@Assisted savedStateHandle: SavedStateHandle,
@Assisted params: Params