From ef3636bdb0762da2ca9674c0679eec8a5cf5158e Mon Sep 17 00:00:00 2001 From: StephenHeaps <5314553+StephenHeaps@users.noreply.github.com> Date: Wed, 15 Nov 2023 07:54:42 -0500 Subject: [PATCH] Fix #8412: Dismiss NFT Discovery and NFT Removal popups when wallet is auto-locked (#8413) Dismiss NFT Discovery and NFT Removal popups when wallet is auto-locked --- Sources/BraveWallet/Crypto/NFT/NFTView.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sources/BraveWallet/Crypto/NFT/NFTView.swift b/Sources/BraveWallet/Crypto/NFT/NFTView.swift index 7d8f46c5326..3b838ddd6ba 100644 --- a/Sources/BraveWallet/Crypto/NFT/NFTView.swift +++ b/Sources/BraveWallet/Crypto/NFT/NFTView.swift @@ -421,6 +421,15 @@ struct NFTView: View { } }) } + .onChange(of: keyringStore.isWalletLocked) { isLocked in + guard isLocked else { return } + if isShowingNFTDiscoveryAlert { + isShowingNFTDiscoveryAlert = false + } + if nftToBeRemoved != nil { + nftToBeRemoved = nil + } + } .onAppear { Task { isNFTDiscoveryEnabled = await nftStore.isNFTDiscoveryEnabled()