From fa17ee590ae1dfec8f6e46c93b5a9cabb2db2d27 Mon Sep 17 00:00:00 2001 From: Nuo Xu Date: Thu, 10 Oct 2024 18:24:02 -0400 Subject: [PATCH] RequestContainerView.onDisappear will get called right after .onAppear in iOS18 which closes the ConfirmationStore. move the logic of closing store from RequestContainerView.onDisappear to isPresentingPendingRequest is set to false. --- .../Sources/BraveWallet/Crypto/Stores/CryptoStore.swift | 3 ++- .../Sources/BraveWallet/Panels/RequestContainerView.swift | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ios/brave-ios/Sources/BraveWallet/Crypto/Stores/CryptoStore.swift b/ios/brave-ios/Sources/BraveWallet/Crypto/Stores/CryptoStore.swift index 06fb6bf906c7..a1928b1d1e65 100644 --- a/ios/brave-ios/Sources/BraveWallet/Crypto/Stores/CryptoStore.swift +++ b/ios/brave-ios/Sources/BraveWallet/Crypto/Stores/CryptoStore.swift @@ -76,7 +76,8 @@ public class CryptoStore: ObservableObject, WalletObserverStore { @Published var isPresentingPendingRequest: Bool = false { didSet { if !isPresentingPendingRequest { - confirmationStore = nil + closeConfirmationStore() + closeSignMessageRequestStore() } } } diff --git a/ios/brave-ios/Sources/BraveWallet/Panels/RequestContainerView.swift b/ios/brave-ios/Sources/BraveWallet/Panels/RequestContainerView.swift index 278155261a1a..92019ba063e7 100644 --- a/ios/brave-ios/Sources/BraveWallet/Panels/RequestContainerView.swift +++ b/ios/brave-ios/Sources/BraveWallet/Panels/RequestContainerView.swift @@ -94,11 +94,5 @@ struct RequestContainerView: View { } } .navigationViewStyle(.stack) - .onDisappear { - // `onDisappear` on individual views will trigger for navigation pushes. - // Close stores when navigation covers manual dismiss & onDismiss() cases. - cryptoStore.closeConfirmationStore() - cryptoStore.closeSignMessageRequestStore() - } } }