mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 15:03:16 +00:00
ios: fix repeatedly showing updated conditions
This commit is contained in:
1 parent
78b3b12ec1
commit
bab63d8f27
2 files changed
+13
-10
No files matched your search
@@ -295,12 +295,16 @@ struct ContentView: View {
|
||||
case let .whatsNew(updatedConditions):
|
||||
WhatsNewView(updatedConditions: updatedConditions)
|
||||
.modifier(ThemedBackground())
|
||||
.if(updatedConditions) { v in
|
||||
v.task { await setConditionsNotified_() }
|
||||
}
|
||||
case .updatedConditions:
|
||||
UsageConditionsView(
|
||||
currUserServers: Binding.constant([]),
|
||||
userServers: Binding.constant([])
|
||||
)
|
||||
.modifier(ThemedBackground(grouped: true))
|
||||
.task { await setConditionsNotified_() }
|
||||
}
|
||||
}
|
||||
if chatModel.setDeliveryReceipts {
|
||||
@@ -313,6 +317,15 @@ struct ContentView: View {
|
||||
.onContinueUserActivity("INStartVideoCallIntent", perform: processUserActivity)
|
||||
}
|
||||
|
||||
private func setConditionsNotified_() async {
|
||||
do {
|
||||
let conditionsId = ChatModel.shared.conditions.currentConditions.conditionsId
|
||||
try await setConditionsNotified(conditionsId: conditionsId)
|
||||
} catch let error {
|
||||
logger.error("setConditionsNotified error: \(responseError(error))")
|
||||
}
|
||||
}
|
||||
|
||||
private func processUserActivity(_ activity: NSUserActivity) {
|
||||
let intent = activity.interaction?.intent
|
||||
if let intent = intent as? INStartCallIntent {
|
||||
|
||||
@@ -598,16 +598,6 @@ struct WhatsNewView: View {
|
||||
|
||||
var body: some View {
|
||||
whatsNewView()
|
||||
.task {
|
||||
if updatedConditions {
|
||||
do {
|
||||
let conditionsId = ChatModel.shared.conditions.currentConditions.conditionsId
|
||||
try await setConditionsNotified(conditionsId: conditionsId)
|
||||
} catch let error {
|
||||
logger.error("WhatsNewView setConditionsNotified error: \(responseError(error))")
|
||||
}
|
||||
}
|
||||
}
|
||||
.sheet(item: $sheetItem) { item in
|
||||
switch item {
|
||||
case .showConditions:
|
||||
|
||||
Reference in new issue
Block a user