diff --git a/Linphone/GeneratedGit.swift b/Linphone/GeneratedGit.swift index 5bdeb212c..db490855a 100644 --- a/Linphone/GeneratedGit.swift +++ b/Linphone/GeneratedGit.swift @@ -2,6 +2,6 @@ import Foundation public enum AppGitInfo { public static let branch = "release/6.2" - public static let commit = "b764c068e" + public static let commit = "eaa19e60a" public static let tag = "6.2.0-beta" } diff --git a/Linphone/UI/Call/CallView.swift b/Linphone/UI/Call/CallView.swift index ecb939c1b..a274e31fb 100644 --- a/Linphone/UI/Call/CallView.swift +++ b/Linphone/UI/Call/CallView.swift @@ -110,6 +110,8 @@ struct CallView: View { callViewModel: callViewModel, isShowStartCallFragment: $isShowStartCallFragment, showingDialer: $showingDialer, + transferAddress: .constant(nil), + isShowTransferPopup: .constant(false), currentCall: callViewModel.currentCall ) .presentationDetents([.medium]) @@ -147,6 +149,8 @@ struct CallView: View { callViewModel: callViewModel, isShowStartCallFragment: $isShowStartCallFragment, showingDialer: $showingDialer, + transferAddress: .constant(nil), + isShowTransferPopup: .constant(false), currentCall: callViewModel.currentCall ) .presentationDetents([.medium]) @@ -179,6 +183,8 @@ struct CallView: View { callViewModel: callViewModel, isShowStartCallFragment: $isShowStartCallFragment, showingDialer: $showingDialer, + transferAddress: .constant(nil), + isShowTransferPopup: .constant(false), currentCall: callViewModel.currentCall ) } onDismiss: {} diff --git a/Linphone/UI/Main/History/Fragments/DialerBottomSheet.swift b/Linphone/UI/Main/History/Fragments/DialerBottomSheet.swift index cda6c11b7..2da2c7274 100644 --- a/Linphone/UI/Main/History/Fragments/DialerBottomSheet.swift +++ b/Linphone/UI/Main/History/Fragments/DialerBottomSheet.swift @@ -42,6 +42,9 @@ struct DialerBottomSheet: View { @Binding var isShowStartCallFragment: Bool @Binding var showingDialer: Bool + @Binding var transferAddress: Address? + @Binding var isShowTransferPopup: Bool + let currentCall: Call? var body: some View { @@ -405,24 +408,15 @@ struct DialerBottomSheet: View { Button { if !startCallViewModel.searchField.isEmpty { if callViewModel.isTransferInsteadCall { - showingDialer = false - - magicSearch.currentFilter = "" - - magicSearch.searchForContacts() - - if callViewModel.isTransferInsteadCall == true { - callViewModel.isTransferInsteadCall = false + CoreContext.shared.doOnCoreQueue { core in + if let transferAddressTmp = core.interpretUrl(url: startCallViewModel.searchField, applyInternationalPrefix: LinphoneUtils.applyInternationalPrefix(core: core)) { + DispatchQueue.main.async { + showingDialer = false + self.transferAddress = transferAddressTmp + self.isShowTransferPopup = true + } + } } - - callViewModel.resetCallView() - - withAnimation { - isShowStartCallFragment.toggle() - startCallViewModel.interpretAndStartCall() - } - - startCallViewModel.searchField = "" } else { showingDialer = false @@ -504,13 +498,4 @@ struct DialerBottomSheet: View { } } -#Preview { - DialerBottomSheet( - startCallViewModel: StartCallViewModel() - , callViewModel: CallViewModel() - , isShowStartCallFragment: .constant(false) - , showingDialer: .constant(false) - , currentCall: nil) -} - // swiftlint:enable type_body_length diff --git a/Linphone/UI/Main/History/Fragments/StartCallFragment.swift b/Linphone/UI/Main/History/Fragments/StartCallFragment.swift index 25f6b2278..703d9cd82 100644 --- a/Linphone/UI/Main/History/Fragments/StartCallFragment.swift +++ b/Linphone/UI/Main/History/Fragments/StartCallFragment.swift @@ -42,6 +42,7 @@ struct StartCallFragment: View { @Binding var showingDialer: Bool @Binding var isShowStartCallFragment: Bool + @FocusState var isSearchFieldFocused: Bool @State private var delayedColor = Color.white @@ -57,6 +58,8 @@ struct StartCallFragment: View { callViewModel: callViewModel, isShowStartCallFragment: $isShowStartCallFragment, showingDialer: $showingDialer, + transferAddress: $transferAddress, + isShowTransferPopup: $isShowTransferPopup, currentCall: nil ) .presentationDetents([.medium]) @@ -70,6 +73,8 @@ struct StartCallFragment: View { callViewModel: callViewModel, isShowStartCallFragment: $isShowStartCallFragment, showingDialer: $showingDialer, + transferAddress: $transferAddress, + isShowTransferPopup: $isShowTransferPopup, currentCall: nil ) } onDismiss: {}