From f7a27ff91b5e8dfc5b557ca0bc1239e274ae6b38 Mon Sep 17 00:00:00 2001 From: JRoberts <8711996+jr-simplex@users.noreply.github.com> Date: Tue, 5 Jul 2022 15:24:51 +0400 Subject: [PATCH] ios: make calls non expirmental feature, hide experimental features (#777) --- .../Shared/Views/Call/CallController.swift | 1 - apps/ios/Shared/Views/Chat/ChatView.swift | 3 +-- .../Views/UserSettings/CallSettings.swift | 7 +++--- .../Views/UserSettings/SettingsView.swift | 25 ++++++++----------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/apps/ios/Shared/Views/Call/CallController.swift b/apps/ios/Shared/Views/Call/CallController.swift index 23e0609df..5c0e23360 100644 --- a/apps/ios/Shared/Views/Call/CallController.swift +++ b/apps/ios/Shared/Views/Call/CallController.swift @@ -122,7 +122,6 @@ class CallController: NSObject, ObservableObject { func reportNewIncomingCall(invitation: RcvCallInvitation, completion: @escaping (Error?) -> Void) { logger.debug("CallController.reportNewIncomingCall") - if !UserDefaults.standard.bool(forKey: DEFAULT_EXPERIMENTAL_CALLS) { return } // if CallController.useCallKit, let uuid = invitation.callkitUUID { // let update = CXCallUpdate() // update.remoteHandle = CXHandle(type: .generic, value: invitation.contact.displayName) diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 6c5bd9109..bafe83336 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -14,7 +14,6 @@ private let memberImageSize: CGFloat = 34 struct ChatView: View { @EnvironmentObject var chatModel: ChatModel @Environment(\.colorScheme) var colorScheme - @AppStorage(DEFAULT_EXPERIMENTAL_CALLS) private var enableCalls = false @ObservedObject var chat: Chat @Binding var showChatInfo: Bool @State private var composeState = ComposeState() @@ -108,7 +107,7 @@ struct ChatView: View { } } ToolbarItem(placement: .navigationBarTrailing) { - if enableCalls, case let .direct(contact) = cInfo { + if case let .direct(contact) = cInfo { HStack { callButton(contact, .audio, imageName: "phone") callButton(contact, .video, imageName: "video") diff --git a/apps/ios/Shared/Views/UserSettings/CallSettings.swift b/apps/ios/Shared/Views/UserSettings/CallSettings.swift index 516b23753..7bc79dd0b 100644 --- a/apps/ios/Shared/Views/UserSettings/CallSettings.swift +++ b/apps/ios/Shared/Views/UserSettings/CallSettings.swift @@ -21,10 +21,9 @@ struct CallSettings: View { Section("Limitations") { VStack(alignment: .leading, spacing: 8) { textListItem("1.", "Do NOT use SimpleX for emergency calls.") - textListItem("2.", "Pre-arrange the calls, as notifications arrive with a delay (we are improving it).") - textListItem("3.", "The microphone does not work when the app is in the background.") - textListItem("4.", "To prevent the call interruption, enable Do Not Disturb mode.") - textListItem("5.", "If the video fails to connect, flip the camera to resolve it.") + textListItem("2.", "The microphone does not work when the app is in the background.") + textListItem("3.", "To prevent the call interruption, enable Do Not Disturb mode.") + textListItem("4.", "If the video fails to connect, flip the camera to resolve it.") } .font(.callout) .padding(.vertical, 8) diff --git a/apps/ios/Shared/Views/UserSettings/SettingsView.swift b/apps/ios/Shared/Views/UserSettings/SettingsView.swift index 40827bdf4..ab2b8836f 100644 --- a/apps/ios/Shared/Views/UserSettings/SettingsView.swift +++ b/apps/ios/Shared/Views/UserSettings/SettingsView.swift @@ -48,7 +48,6 @@ struct SettingsView: View { @EnvironmentObject var chatModel: ChatModel @Binding var showSettings: Bool @AppStorage(DEFAULT_PENDING_CONNECTIONS) private var pendingConnections = true - @AppStorage(DEFAULT_EXPERIMENTAL_CALLS) private var enableCalls = false var body: some View { let user: User = chatModel.currentUser! @@ -99,13 +98,11 @@ struct SettingsView: View { Text("Notifications") } } - if enableCalls { - NavigationLink { - CallSettings() - .navigationTitle("Your calls") - } label: { - settingsRow("video") { Text("Audio & video calls") } - } + NavigationLink { + CallSettings() + .navigationTitle("Your calls") + } label: { + settingsRow("video") { Text("Audio & video calls") } } NavigationLink { PrivacySettings() @@ -176,12 +173,12 @@ struct SettingsView: View { Text("Install [SimpleX Chat for terminal](https://github.com/simplex-chat/simplex-chat)") .padding(.leading, indent) } - NavigationLink { - ExperimentalFeaturesView() - .navigationTitle("Experimental features") - } label: { - settingsRow("gauge") { Text("Experimental features") } - } +// NavigationLink { +// ExperimentalFeaturesView() +// .navigationTitle("Experimental features") +// } label: { +// settingsRow("gauge") { Text("Experimental features") } +// } Text("v\(appVersion ?? "?") (\(appBuild ?? "?"))") } }