forked from upstream-mirrors/quik
Refactor name of Sync interactor
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ import io.reactivex.Flowable
|
|||||||
import io.realm.Realm
|
import io.realm.Realm
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class SyncConversations @Inject constructor(
|
class FullSync @Inject constructor(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val cursorToConversationFlowable: CursorToConversationFlowable,
|
private val cursorToConversationFlowable: CursorToConversationFlowable,
|
||||||
private val cursorToMessageFlowable: CursorToMessageFlowable) : Interactor<Long, Unit>() {
|
private val cursorToMessageFlowable: CursorToMessageFlowable) : Interactor<Long, Unit>() {
|
||||||
@@ -4,7 +4,7 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.provider.Telephony
|
import android.provider.Telephony
|
||||||
import com.moez.QKSMS.common.di.AppComponentManager
|
import com.moez.QKSMS.common.di.AppComponentManager
|
||||||
import com.moez.QKSMS.domain.interactor.SyncConversations
|
import com.moez.QKSMS.domain.interactor.FullSync
|
||||||
import com.moez.QKSMS.presentation.base.QkViewModel
|
import com.moez.QKSMS.presentation.base.QkViewModel
|
||||||
import io.reactivex.rxkotlin.plusAssign
|
import io.reactivex.rxkotlin.plusAssign
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
@@ -13,12 +13,12 @@ import javax.inject.Inject
|
|||||||
class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState()) {
|
class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState()) {
|
||||||
|
|
||||||
@Inject lateinit var context: Context
|
@Inject lateinit var context: Context
|
||||||
@Inject lateinit var syncConversations: SyncConversations
|
@Inject lateinit var fullSync: FullSync
|
||||||
|
|
||||||
init {
|
init {
|
||||||
AppComponentManager.appComponent.inject(this)
|
AppComponentManager.appComponent.inject(this)
|
||||||
|
|
||||||
disposables += syncConversations.disposables
|
disposables += fullSync.disposables
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun bindIntents(view: SettingsView) {
|
override fun bindIntents(view: SettingsView) {
|
||||||
@@ -38,7 +38,7 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
|||||||
|
|
||||||
"sync" -> {
|
"sync" -> {
|
||||||
newState { it.copy(syncing = true) }
|
newState { it.copy(syncing = true) }
|
||||||
syncConversations.execute(Unit, {
|
fullSync.execute(Unit, {
|
||||||
newState { it.copy(syncing = false) }
|
newState { it.copy(syncing = false) }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user