mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-25 14:14:39 +00:00
android, desktop: member support list updates, refresh button (#5842)
This commit is contained in:
+1
@@ -144,6 +144,7 @@ fun ModalData.GroupChatInfoView(
|
||||
openMemberSupport = {
|
||||
ModalManager.end.showCustomModal { close ->
|
||||
MemberSupportView(
|
||||
rhId,
|
||||
chat,
|
||||
groupInfo,
|
||||
scrollToItemId,
|
||||
|
||||
+30
-1
@@ -25,13 +25,16 @@ import chat.simplex.common.platform.*
|
||||
import chat.simplex.common.ui.theme.*
|
||||
import chat.simplex.common.views.chat.*
|
||||
import chat.simplex.common.views.chat.item.ItemAction
|
||||
import chat.simplex.common.views.chatlist.setGroupMembers
|
||||
import chat.simplex.common.views.chatlist.unreadCountStr
|
||||
import chat.simplex.common.views.newchat.AddContactLearnMore
|
||||
import chat.simplex.res.MR
|
||||
import dev.icerock.moko.resources.compose.painterResource
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
fun ModalData.MemberSupportView(
|
||||
rhId: Long?,
|
||||
chat: Chat,
|
||||
groupInfo: GroupInfo,
|
||||
scrollToItemId: MutableState<Long?>,
|
||||
@@ -40,7 +43,13 @@ fun ModalData.MemberSupportView(
|
||||
KeyChangeEffect(chatModel.chatId.value) {
|
||||
ModalManager.end.closeModals()
|
||||
}
|
||||
ModalView(close = close) {
|
||||
LaunchedEffect(Unit) {
|
||||
setGroupMembers(rhId, groupInfo, chatModel)
|
||||
}
|
||||
ModalView(
|
||||
close = close,
|
||||
endButtons = { RefreshMembersButton(rhId, groupInfo) }
|
||||
) {
|
||||
MemberSupportViewLayout(
|
||||
chat,
|
||||
groupInfo,
|
||||
@@ -49,6 +58,26 @@ fun ModalData.MemberSupportView(
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun RefreshMembersButton(
|
||||
rhId: Long?,
|
||||
groupInfo: GroupInfo
|
||||
) {
|
||||
IconButton(
|
||||
onClick = {
|
||||
withBGApi {
|
||||
setGroupMembers(rhId, groupInfo, chatModel)
|
||||
}
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painterResource(MR.images.ic_refresh),
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colors.primary
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ModalData.MemberSupportViewLayout(
|
||||
chat: Chat,
|
||||
|
||||
Reference in New Issue
Block a user