Skip to content

Commit

Permalink
Fixed Receive and Send layout scaling up on dismiss on iOS16.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokesh Sehgal committed Dec 6, 2022
1 parent 4388883 commit 5c5777b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions wallet/wallet/Utils/AuthenticationHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class AuthenticationHelper {

switch authError.code {
case .passcodeNotSet:
AppDelegate.isTouchIDVisible = false
authenticationPublisher.send(.success)
case .authenticationFailed:
authenticationPublisher.send(.userFailed)
Expand Down
16 changes: 11 additions & 5 deletions wallet/wallet/Views/ReceiveFunds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ZcashLightClientKit
struct ReceiveFunds: View {

let unifiedAddress: UnifiedAddress
// @Environment(\.presentationMode) var presentationMode
@Environment(\.presentationMode) var presentationMode
@State var selectedTab: Int = 0
@State var qrImage : Image?
var body: some View {
Expand All @@ -37,10 +37,16 @@ struct ReceiveFunds: View {
}
}, trailingItem: {
ARRRCloseButton(action: {
// presentationMode.wrappedValue.dismiss()
if UIApplication.shared.windows.count > 0 {
UIApplication.shared.windows[0].rootViewController?.dismiss(animated: true, completion: nil)
}

if #available(iOS 16.0, *) {
presentationMode.wrappedValue.dismiss()
}else{
if UIApplication.shared.windows.count > 0 {
UIApplication.shared.windows[0].rootViewController?.dismiss(animated: true, completion: nil)
}
}


}).frame(width: Device.isLarge ? 30 : 15, height: Device.isLarge ? 30 : 15).padding(.top,40)
})
.onAppear {
Expand Down
15 changes: 9 additions & 6 deletions wallet/wallet/Views/Send Flow/SendMoneyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SendMoneyView: View {

@State var isSendTapped = false
@EnvironmentObject var flow: SendFlowEnvironment
// @Environment(\.presentationMode) var presentationMode
@Environment(\.presentationMode) var presentationMode
@State var scanViewModel = ScanAddressViewModel(shouldShowSwitchButton: false, showCloseButton: true)
@State var adjustTransaction = false
@State var validateTransaction = false
Expand Down Expand Up @@ -212,11 +212,14 @@ struct SendMoneyView: View {
}, trailingItem: {
ARRRCloseButton(action: {
self.onDismissRemoveObservers()
// presentationMode.wrappedValue.dismiss()
if UIApplication.shared.windows.count > 0 {
UIApplication.shared.windows[0].rootViewController?.dismiss(animated: true, completion: nil)
}

if #available(iOS 16.0, *) {
presentationMode.wrappedValue.dismiss()
}else{
if UIApplication.shared.windows.count > 0 {
UIApplication.shared.windows[0].rootViewController?.dismiss(animated: true, completion: nil)
}
}

}).frame(width: 20, height: 20)
.padding(.top,40)
})
Expand Down

0 comments on commit 5c5777b

Please sign in to comment.