mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
fix start chat alert
This commit is contained in:
+4
-7
@@ -25,6 +25,10 @@ import dev.icerock.moko.resources.compose.stringResource
|
||||
|
||||
@Composable
|
||||
fun ModalData.ChooseServerOperators(onboarding: Boolean, close: () -> Unit) {
|
||||
LaunchedEffect(Unit) {
|
||||
prepareChatBeforeFinishingOnboarding()
|
||||
}
|
||||
|
||||
CompositionLocalProvider(LocalAppBarHandler provides rememberAppBarHandler()) {
|
||||
ModalView({}, showClose = false, endButtons = {
|
||||
IconButton({ (if (onboarding) ModalManager.fullscreen else ModalManager.start).showModal { ChooseServerOperatorsInfoView() } }) {
|
||||
@@ -295,9 +299,6 @@ private fun AcceptConditionsButton(
|
||||
private fun continueToNextStep(onboarding: Boolean, close: () -> Unit) {
|
||||
if (onboarding) {
|
||||
appPrefs.onboardingStage.set(if (appPlatform.isAndroid) OnboardingStage.Step4_SetNotificationsMode else OnboardingStage.OnboardingComplete)
|
||||
if (appPlatform.isDesktop) {
|
||||
startChatIfNeeded()
|
||||
}
|
||||
} else {
|
||||
close()
|
||||
}
|
||||
@@ -308,10 +309,6 @@ private fun continueToSetNotificationsAfterAccept() {
|
||||
ModalManager.fullscreen.showModalCloseable(showClose = false) { SetNotificationsMode(chatModel) }
|
||||
}
|
||||
|
||||
private fun startChatIfNeeded() {
|
||||
prepareChatBeforeNotificationsSetup()
|
||||
}
|
||||
|
||||
private fun enabledOperators(operators: List<ServerOperator>, selectedOperatorIds: Set<Long>): List<ServerOperator>? {
|
||||
val ops = ArrayList(operators)
|
||||
if (ops.isNotEmpty()) {
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ import chat.simplex.res.MR
|
||||
@Composable
|
||||
fun SetNotificationsMode(m: ChatModel) {
|
||||
LaunchedEffect(Unit) {
|
||||
prepareChatBeforeNotificationsSetup()
|
||||
prepareChatBeforeFinishingOnboarding()
|
||||
}
|
||||
|
||||
CompositionLocalProvider(LocalAppBarHandler provides rememberAppBarHandler()) {
|
||||
@@ -99,7 +99,7 @@ fun <T> SelectableCard(currentValue: State<T>, newValue: T, title: String, descr
|
||||
Spacer(Modifier.height(14.dp))
|
||||
}
|
||||
|
||||
fun prepareChatBeforeNotificationsSetup() {
|
||||
fun prepareChatBeforeFinishingOnboarding() {
|
||||
// No visible users but may have hidden. In this case chat should be started anyway because it's stopped on this stage with hidden users
|
||||
if (chatModel.users.any { u -> !u.user.hidden }) return
|
||||
withBGApi {
|
||||
|
||||
Reference in New Issue
Block a user