Revert "ui: show What's new once when usage conditions are updated (#8088)"

This reverts commit d18539d1bb.
This commit is contained in:
Evgeny Poberezkin committed 2026-11-11 11:36:47 +00:00
1 parent e097466325
commit 3b5152d6ed
2 files changed
+4 -23

No files matched your search

+2 -10
View File
@@ -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 {
@@ -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<Animate
val oneHandUI = remember { appPrefs.oneHandUI.state }
LaunchedEffect(Unit) {
if (noticesShown) return@LaunchedEffect
val showWhatsNew = shouldShowWhatsNew(chatModel)
val showUpdatedConditions = chatModel.conditions.value.conditionsAction is UsageConditionsAction.Review
val showUpdatedConditions = chatModel.conditions.value.conditionsAction?.shouldShowNotice ?: false
if (showWhatsNew || showUpdatedConditions) {
// Requested here, so that the country is known by the time the modal opens
platform.androidLoadPlayStoreCountry()
delay(1000L)
noticesShown = true
if (showWhatsNew) {
ModalManager.center.showCustomModal { close -> 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