1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-3659 Multiplayer | Invite loading screen, dismiss (#2433)

This commit is contained in:
Konstantin Ivanov 2025-05-22 12:47:03 +02:00 committed by GitHub
parent 6b2404a14c
commit 98b0bcc91c
Signed by: github
GPG key ID: B5690EEEBB952194

View file

@ -94,22 +94,24 @@ class RequestJoinSpaceFragment : BaseBottomSheetComposeFragment() {
}
}
MaterialTheme(typography = typography) {
val showModal = vm.showEnableNotificationDialog.collectAsStateWithLifecycle().value
val isLoadingInvite = vm.showLoadingInviteProgress.collectAsStateWithLifecycle().value
when(val state = vm.state.collectAsStateWithLifecycle().value) {
val showModal =
vm.showEnableNotificationDialog.collectAsStateWithLifecycle().value
val isLoadingInvite =
vm.showLoadingInviteProgress.collectAsStateWithLifecycle().value
when (val state = vm.state.collectAsStateWithLifecycle().value) {
is TypedViewState.Loading, is TypedViewState.Success -> {
val isLoading: Boolean
val spaceName: String
val createdByName: String
val withoutApprove : Boolean
val withoutApprove: Boolean
if (state is TypedViewState.Loading) {
isLoading = true
spaceName = stringResource(R.string.three_dots_text_placeholder)
createdByName = stringResource(R.string.three_dots_text_placeholder)
withoutApprove = false
}
else {
isLoading = vm.isRequestInProgress.collectAsStateWithLifecycle().value
} else {
isLoading =
vm.isRequestInProgress.collectAsStateWithLifecycle().value
with(state as TypedViewState.Success) {
spaceName = state.data.spaceName
createdByName = state.data.creatorName
@ -121,7 +123,10 @@ class RequestJoinSpaceFragment : BaseBottomSheetComposeFragment() {
.fillMaxWidth()
.windowInsetsPadding(WindowInsets.navigationBars),
onDismissRequest = {
if (!isLoadingInvite) {
if (isLoadingInvite) {
vm.onCancelLoadingInviteClicked()
dismiss()
} else {
dismiss()
}
},
@ -172,8 +177,9 @@ class RequestJoinSpaceFragment : BaseBottomSheetComposeFragment() {
}
}
}
is TypedViewState.Error -> {
when(val err = state.error) {
when (val err = state.error) {
is ErrorView.AlreadySpaceMember -> {
Announcement(
title = stringResource(id = R.string.multiplayer_already_space_member),