Remove dependency injection from core module and data module from presentation-widget module
Includes side effects: - No longer need to restart app for user agent string change to take effect - parseAs extension function requires a Json instance in the calling context, which doesn't necessarily need to be the default one provided by Injekt
This commit is contained in:
+6
-10
@@ -7,21 +7,17 @@ import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.drop
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import tachiyomi.data.DatabaseHandler
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import tachiyomi.domain.updates.interactor.GetUpdates
|
||||
|
||||
class TachiyomiWidgetManager(
|
||||
private val database: DatabaseHandler = Injekt.get(),
|
||||
private val getUpdates: GetUpdates,
|
||||
) {
|
||||
|
||||
fun Context.init(scope: LifecycleCoroutineScope) {
|
||||
database.subscribeToList {
|
||||
updatesViewQueries.getUpdatesByReadStatus(
|
||||
read = false,
|
||||
after = UpdatesGridGlanceWidget.DateLimit.timeInMillis,
|
||||
)
|
||||
}
|
||||
getUpdates.subscribe(
|
||||
read = false,
|
||||
after = UpdatesGridGlanceWidget.DateLimit.timeInMillis,
|
||||
)
|
||||
.drop(1)
|
||||
.distinctUntilChanged()
|
||||
.onEach {
|
||||
|
||||
Reference in New Issue
Block a user