From 3b5152d6ed642c90d9a2d74b598328d2f0b414d3 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Wed, 11 Nov 2026 11:36:47 +0000 Subject: [PATCH] Revert "ui: show What's new once when usage conditions are updated (#8088)" This reverts commit d18539d1bb8390c66bffed0560bfa74850960647. --- apps/ios/Shared/ContentView.swift | 12 ++---------- .../simplex/common/views/chatlist/ChatListView.kt | 15 ++------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/apps/ios/Shared/ContentView.swift b/apps/ios/Shared/ContentView.swift index 6761f47e18..f789037aa7 100644 --- a/apps/ios/Shared/ContentView.swift +++ b/apps/ios/Shared/ContentView.swift @@ -12,12 +12,10 @@ import SimpleXChat private enum NoticesSheet: Identifiable { case whatsNew(updatedConditions: Bool) - case updatedConditions var id: String { switch self { case .whatsNew: return "whatsNew" - case .updatedConditions: return "updatedConditions" } } } @@ -275,12 +273,10 @@ struct ContentView: View { DispatchQueue.main.asyncAfter(deadline: .now() + 1) { if !noticesShown { let showWhatsNew = shouldShowWhatsNew() - let showUpdatedConditions = if case .review = chatModel.conditions.conditionsAction { true } else { false } + let showUpdatedConditions = chatModel.conditions.conditionsAction?.showNotice ?? false noticesShown = showWhatsNew || showUpdatedConditions - if showWhatsNew { + if showWhatsNew || showUpdatedConditions { noticesSheetItem = .whatsNew(updatedConditions: showUpdatedConditions) - } else if showUpdatedConditions { - noticesSheetItem = .updatedConditions } } } @@ -299,10 +295,6 @@ struct ContentView: View { .if(updatedConditions) { v in v.task { await setConditionsNotified_() } } - case .updatedConditions: - UsageConditionsView(currUserServers: Binding.constant([]), userServers: Binding.constant([])) - .modifier(ThemedBackground(grouped: true)) - .task { if chatModel.conditions.conditionsAction?.showNotice ?? false { await setConditionsNotified_() } } } } if chatModel.setDeliveryReceipts { diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt index 44b6a2f30e..1ce01f4a69 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListView.kt @@ -46,7 +46,6 @@ import chat.simplex.common.views.badges.* import chat.simplex.common.views.newchat.* import chat.simplex.common.views.onboarding.* import chat.simplex.common.views.usersettings.* -import chat.simplex.common.views.usersettings.networkAndServers.UsageConditionsView import chat.simplex.res.* import dev.icerock.moko.resources.ImageResource import dev.icerock.moko.resources.StringResource @@ -240,22 +239,13 @@ fun ChatListView(chatModel: ChatModel, userPickerState: MutableStateFlow WhatsNewView(close = close, updatedConditions = showUpdatedConditions) } - } else { - ModalManager.center.showModalCloseable { close -> UsageConditionsView(mutableStateOf(emptyList()), mutableStateOf(emptyList()), close, chatModel.remoteHostId()) } - if (chatModel.conditions.value.conditionsAction?.shouldShowNotice == true) { - try { chatModel.controller.setConditionsNotified(rh = chatModel.remoteHostId(), conditionsId = chatModel.conditions.value.currentConditions.conditionsId) } catch (e: Exception) { Log.d(TAG, "ChatListView setConditionsNotified error: ${e.message}") } - } - } + ModalManager.center.showCustomModal { close -> WhatsNewView(close = close, updatedConditions = showUpdatedConditions) } } } @@ -966,7 +956,6 @@ private fun ErrorSettingsView() { } private var lazyListState = 0 to 0 -private var noticesShown = false enum class ScrollDirection { Up, Down, Idle