disable all intereactions when reloading ttl

This commit is contained in:
Diogo
2025-01-17 23:36:07 +00:00
committed by Evgeny Poberezkin
parent a294f58cc7
commit d0878b9066
3 changed files with 5 additions and 7 deletions
@@ -191,7 +191,7 @@ fun ChatInfoView(
)
if (progressIndicator.value) {
ProgressIndicator()
ProgressIndicator(true)
}
}
}
@@ -59,7 +59,6 @@ fun ModalData.GroupChatInfoView(chatModel: ChatModel, rhId: Long?, chatId: Strin
val sendReceipts = remember { mutableStateOf(SendReceipts.fromBool(groupInfo.chatSettings.sendRcpts, currentUser.sendRcptsSmallGroups)) }
val chatItemTTL = remember(groupInfo.id) { mutableStateOf(if (groupInfo.chatItemTTL != null) ChatItemTTL.fromSeconds(groupInfo.chatItemTTL) else null) }
val progressIndicator = rememberSaveable(groupInfo.id) { mutableStateOf(false) }
// TODO [ttl] disable all interactions while ttl is changing
val scope = rememberCoroutineScope()
GroupChatInfoLayout(
@@ -143,7 +142,7 @@ fun ModalData.GroupChatInfoView(chatModel: ChatModel, rhId: Long?, chatId: Strin
)
if (progressIndicator.value) {
ProgressIndicator()
ProgressIndicator(true)
}
}
}
@@ -1,9 +1,8 @@
package chat.simplex.common.views.chat.group
import SectionBottomSpacer
import androidx.compose.foundation.*
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
@@ -199,9 +198,9 @@ private fun RoleSelectionRow(groupInfo: GroupInfo, selectedRole: MutableState<Gr
}
@Composable
fun ProgressIndicator() {
fun ProgressIndicator(disableInteractions: Boolean = false) {
Box(
Modifier.fillMaxSize(),
Modifier.fillMaxSize().then(if (disableInteractions) Modifier.clickable(enabled = false, onClick = {}) else Modifier),
contentAlignment = Alignment.Center
) {
CircularProgressIndicator(