knock requests : format and clean
This commit is contained in:
parent
a973c8f028
commit
7f372282dc
11 changed files with 10 additions and 18 deletions
|
|
@ -10,8 +10,8 @@ package io.element.android.features.knockrequests.impl.banner
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import io.element.android.features.knockrequests.impl.data.KnockRequestPresentable
|
||||
import io.element.android.features.knockrequests.impl.R
|
||||
import io.element.android.features.knockrequests.impl.data.KnockRequestPresentable
|
||||
import io.element.android.libraries.core.extensions.firstIfSingle
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.width
|
|||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.drawWithContent
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
|
|
@ -57,7 +56,6 @@ import io.element.android.libraries.designsystem.theme.components.Surface
|
|||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import timber.log.Timber
|
||||
|
||||
private const val MAX_AVATAR_COUNT = 3
|
||||
|
||||
|
|
|
|||
|
|
@ -32,5 +32,4 @@ interface KnockRequestPresentable {
|
|||
fun getBestName(): String {
|
||||
return displayName?.takeIf { it.isNotEmpty() } ?: userId.value
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ class KnockRequestsService(
|
|||
knockRequestsFlow: Flow<List<KnockRequest>>,
|
||||
coroutineScope: CoroutineScope,
|
||||
) {
|
||||
|
||||
// Keep track of the knock requests that have been handled, so we don't have to wait for sync to remove them.
|
||||
private val handledKnockRequestIds = MutableStateFlow<Set<EventId>>(emptySet())
|
||||
|
||||
|
|
|
|||
|
|
@ -229,7 +229,6 @@ private fun KnockRequestActionConfirmation(
|
|||
stringResource(R.string.screen_knock_requests_list_accept_all_alert_title),
|
||||
stringResource(R.string.screen_knock_requests_list_accept_all_alert_description),
|
||||
stringResource(R.string.screen_knock_requests_list_accept_all_alert_confirm_button_title),
|
||||
|
||||
)
|
||||
is KnockRequestsActionTarget.Decline -> Triple(
|
||||
stringResource(R.string.screen_knock_requests_list_decline_alert_title),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import kotlinx.coroutines.test.runTest
|
|||
import org.junit.Test
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class) class KnockRequestsBannerPresenterTest {
|
||||
|
||||
@Test
|
||||
fun `present - when feature is disabled then the banner should be hidden`() = runTest {
|
||||
val knockRequests = flowOf(listOf(FakeKnockRequest()))
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.junit.rules.TestRule
|
|||
import org.junit.runner.RunWith
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class KnockRequestsListViewTest {
|
||||
class KnockRequestsBannerViewTest {
|
||||
@get:Rule
|
||||
val rule = createAndroidComposeRule<ComponentActivity>()
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ import kotlinx.collections.immutable.toPersistentList
|
|||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
|
@ -109,7 +108,6 @@ class RoomDetailsPresenter @Inject constructor(
|
|||
val roomType by getRoomType(dmMember, currentMember)
|
||||
val roomCallState = roomCallStatePresenter.present()
|
||||
|
||||
|
||||
val topicState = remember(canEditTopic, roomTopic, roomType) {
|
||||
val topic = roomTopic
|
||||
when {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue