close picker on desktop opening modals

This commit is contained in:
Diogo
2024-08-29 17:05:58 +01:00
parent ff8e55599b
commit 48398c2119
@@ -324,7 +324,8 @@ fun UserPicker(
Column(
Modifier
.height(IntrinsicSize.Min)
.then(if (appPlatform.isAndroid) Modifier.fillMaxWidth() else Modifier.width(IntrinsicSize.Min))
.then(if (appPlatform.isDesktop) Modifier.widthIn(max = 375.dp) else Modifier)
.fillMaxWidth()
.background(MaterialTheme.colors.surface)
) {
val currentRemoteHost = remember { chatModel.currentRemoteHost }.value
@@ -355,9 +356,19 @@ fun UserPicker(
userPickerState = userPickerState,
drawerState = drawerState,
remoteHosts = remoteHosts,
showCustomModal = { modalView -> { ModalManager.start.showCustomModal { close -> modalView(chatModel, close) } } },
showCustomModal = { modalView ->
{
if (appPlatform.isDesktop) {
userPickerState.value = AnimatedViewState.HIDING
}
ModalManager.start.showCustomModal { close -> modalView(chatModel, close) }
}
},
withAuth = ::doWithAuth,
showModalWithSearch = { modalView ->
if (appPlatform.isDesktop) {
userPickerState.value = AnimatedViewState.HIDING
}
ModalManager.start.showCustomModal { close ->
val search = rememberSaveable { mutableStateOf("") }
ModalView(