RoomList: introduces a SyncService

This commit is contained in:
ganfra 2023-06-22 16:47:32 +02:00
parent e0e50a97e9
commit ca080fd6af
10 changed files with 214 additions and 36 deletions

View file

@ -127,6 +127,7 @@ class LoggedInFlowNode @AssistedInject constructor(
) : NodeInputs
private val inputs: Inputs = inputs()
private val syncService = inputs.matrixClient.syncService()
private val loggedInFlowProcessor = LoggedInEventProcessor(
snackbarDispatcher,
inputs.matrixClient.roomMembershipObserver(),
@ -147,10 +148,10 @@ class LoggedInFlowNode @AssistedInject constructor(
loggedInFlowProcessor.observeEvents(coroutineScope)
},
onResume = {
inputs.matrixClient.startSync()
syncService.startSync()
},
onPause = {
inputs.matrixClient.stopSync()
syncService.stopSync()
},
onDestroy = {
val imageLoaderFactory = bindings<MatrixUIBindings>().notLoggedInImageLoaderFactory()