refactor (start chat) : use invite people module in room details screen

This commit is contained in:
ganfra 2025-08-08 19:06:19 +02:00 committed by Benoit Marty
parent bfd1182baf
commit 74f6a83219
20 changed files with 207 additions and 543 deletions

View file

@ -7,8 +7,10 @@
package io.element.android.services.apperror.impl
import android.content.Context
import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.libraries.di.AppScope
import io.element.android.libraries.di.ApplicationContext
import io.element.android.libraries.di.SingleIn
import io.element.android.services.apperror.api.AppErrorState
import io.element.android.services.apperror.api.AppErrorStateService
@ -18,7 +20,9 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
@SingleIn(AppScope::class)
class DefaultAppErrorStateService @Inject constructor() : AppErrorStateService {
class DefaultAppErrorStateService @Inject constructor(
@ApplicationContext private val context: Context,
) : AppErrorStateService {
private val currentAppErrorState = MutableStateFlow<AppErrorState>(AppErrorState.NoError)
override val appErrorStateFlow: StateFlow<AppErrorState> = currentAppErrorState
@ -31,4 +35,10 @@ class DefaultAppErrorStateService @Inject constructor() : AppErrorStateService {
},
)
}
override fun showError(titleRes: Int, bodyRes: Int) {
val title = context.getString(titleRes)
val body = context.getString(bodyRes)
showError(title, body)
}
}