From f0781adbd3d4ec3449dd14a248f636950246688f Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Sat, 7 Dec 2024 22:51:23 +0400 Subject: [PATCH] desktop: fix opening operators on onboarding (#5351) --- .../views/onboarding/ChooseServerOperators.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/ChooseServerOperators.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/ChooseServerOperators.kt index dcb7d7e133..2f84166362 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/ChooseServerOperators.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/ChooseServerOperators.kt @@ -14,10 +14,8 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.AnnotatedString -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import chat.simplex.common.model.* import chat.simplex.common.model.ChatController.appPrefs import chat.simplex.common.platform.* @@ -55,7 +53,7 @@ fun ModalData.ChooseServerOperators( Column(Modifier.fillMaxWidth().padding(horizontal = DEFAULT_PADDING), horizontalAlignment = Alignment.CenterHorizontally) { OnboardingInformationButton( stringResource(MR.strings.how_it_helps_privacy), - onClick = { modalManager.showModal { ChooseServerOperatorsInfoView() } } + onClick = { modalManager.showModal { ChooseServerOperatorsInfoView(modalManager) } } ) } @@ -346,7 +344,9 @@ private fun enabledOperators(operators: List, selectedOperatorId } @Composable -private fun ChooseServerOperatorsInfoView() { +private fun ChooseServerOperatorsInfoView( + modalManager: ModalManager +) { ColumnWithScrollBar { AppBarTitle(stringResource(MR.strings.onboarding_network_operators)) @@ -362,7 +362,7 @@ private fun ChooseServerOperatorsInfoView() { SectionView(title = stringResource(MR.strings.onboarding_network_about_operators).uppercase()) { chatModel.conditions.value.serverOperators.forEach { op -> - ServerOperatorRow(op) + ServerOperatorRow(op, modalManager) } } SectionBottomSpacer() @@ -371,11 +371,12 @@ private fun ChooseServerOperatorsInfoView() { @Composable() private fun ServerOperatorRow( - operator: ServerOperator + operator: ServerOperator, + modalManager: ModalManager ) { SectionItemView( { - ModalManager.start.showModalCloseable { close -> + modalManager.showModalCloseable { close -> OperatorInfoView(operator) } }