From 8e22a8d2a498af0fa1f447e657e7c24b514e0200 Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 14:38:30 +0300 Subject: [PATCH 1/7] Select recepient when send crypto refactoring --- .../project.pbxproj | 6 ---- .../Entities/CoinRecord.swift | 2 +- .../Entities/CoinRegexPattern.swift | 30 ------------------- .../Mock/MockEntitiesFabric+SendCrypto.swift | 2 +- .../Wallets/BlockchainType+Extension.swift | 25 +++++++++++++++- .../SelectCryptoAssetToSendView.swift | 20 +++---------- .../SendCryptoAssetSelectReceiverView.swift | 2 +- .../SendCryptoAsset/SendCryptoAsset.swift | 14 ++++----- .../SendCryptoAssetViewModel.swift | 12 ++++---- ...SendCryptoQRWalletAddressScannerView.swift | 2 +- .../SendCryptoReceiverInfoTitleView.swift | 2 +- 11 files changed, 46 insertions(+), 71 deletions(-) delete mode 100644 unstoppable-ios-app/domains-manager-ios/Entities/CoinRegexPattern.swift diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj index 365bcc017..a693963ad 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj @@ -120,8 +120,6 @@ C6011AB628F4022300342666 /* DomainProfileCryptoSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6011AB528F4022300342666 /* DomainProfileCryptoSection.swift */; }; C6011ABD28F4045000342666 /* DomainProfileTopInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6011ABB28F4045000342666 /* DomainProfileTopInfoCell.swift */; }; C6011AC128F4045000342666 /* DomainProfileTopInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C6011ABC28F4045000342666 /* DomainProfileTopInfoCell.xib */; }; - C60319922C29775E00A77109 /* CoinRegexPattern.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60319912C29775E00A77109 /* CoinRegexPattern.swift */; }; - C60319932C29775E00A77109 /* CoinRegexPattern.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60319912C29775E00A77109 /* CoinRegexPattern.swift */; }; C60319952C2B0ED100A77109 /* FB_UD_MPC_MessageSigningType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60319942C2B0ED100A77109 /* FB_UD_MPC_MessageSigningType.swift */; }; C60319962C2B0ED100A77109 /* FB_UD_MPC_MessageSigningType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60319942C2B0ED100A77109 /* FB_UD_MPC_MessageSigningType.swift */; }; C60319982C2C1F7400A77109 /* BlockchainType+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C60319972C2C1F7400A77109 /* BlockchainType+Extension.swift */; }; @@ -2790,7 +2788,6 @@ C6011AB528F4022300342666 /* DomainProfileCryptoSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainProfileCryptoSection.swift; sourceTree = ""; }; C6011ABB28F4045000342666 /* DomainProfileTopInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainProfileTopInfoCell.swift; sourceTree = ""; }; C6011ABC28F4045000342666 /* DomainProfileTopInfoCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DomainProfileTopInfoCell.xib; sourceTree = ""; }; - C60319912C29775E00A77109 /* CoinRegexPattern.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinRegexPattern.swift; sourceTree = ""; }; C60319942C2B0ED100A77109 /* FB_UD_MPC_MessageSigningType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FB_UD_MPC_MessageSigningType.swift; sourceTree = ""; }; C60319972C2C1F7400A77109 /* BlockchainType+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BlockchainType+Extension.swift"; sourceTree = ""; }; C603A53528522C0D003962E3 /* IgnoreFailureArrayElement+PropertyWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "IgnoreFailureArrayElement+PropertyWrapper.swift"; sourceTree = ""; }; @@ -7553,7 +7550,6 @@ C61DB10D2B95925C00CDA243 /* BalanceStringFormatter.swift */, C63B1F332A4595D000B1D7D1 /* Base64DataTransformer.swift */, C6EECE962833A3E400978ED5 /* CoinRecord.swift */, - C60319912C29775E00A77109 /* CoinRegexPattern.swift */, C6C9DEAD2834BD9300BAC36F /* CopyWalletAddressPullUpHandler.swift */, C6D5DABB2836021300379C38 /* CryptoRecord.swift */, C68017852886730300524712 /* CurrencyImageLoader.swift */, @@ -9426,7 +9422,6 @@ C64939FC2B637DDB00457363 /* ReverseResolutionSelectionView.swift in Sources */, C69F99412A9F1478004B1958 /* DomainProfileBadgeDisplayInfo.swift in Sources */, C69F99242A9F1264004B1958 /* ClearListBackground.swift in Sources */, - C60319922C29775E00A77109 /* CoinRegexPattern.swift in Sources */, C6456F0B27FF299800A517D5 /* UIView.swift in Sources */, C6FFBADE2B833C3600CB442D /* ChatListChatRowView.swift in Sources */, C6D3B9D92A6ECC9C0091B279 /* XMTPEntitiesTransformer.swift in Sources */, @@ -10974,7 +10969,6 @@ C6102FC82B6A339A0098AF75 /* HomeWebAccountView.swift in Sources */, C6B761E02BB3D78F00773943 /* SerializedWalletTransaction.swift in Sources */, C6BF6BDD2B8F11CC006CC2BD /* TaskWithDeadline.swift in Sources */, - C60319932C29775E00A77109 /* CoinRegexPattern.swift in Sources */, C6534A922BBFBA10008EEBB5 /* HomeExploreFollowersSectionView.swift in Sources */, C61807BE2B19A0CB0032E543 /* Extension-String+Preview.swift in Sources */, C621A4402BB10EFD00CB5CB9 /* QRScannerPreviewView.swift in Sources */, diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/CoinRecord.swift b/unstoppable-ios-app/domains-manager-ios/Entities/CoinRecord.swift index e10333e50..f8ff0d583 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/CoinRecord.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/CoinRecord.swift @@ -20,7 +20,7 @@ struct CoinRecord: Hashable, Comparable, CustomStringConvertible, Codable { self.ticker = ticker self.version = version self.expandedTicker = expandedTicker - self.regexPattern = regexPattern ?? CoinRegexPattern.ETH.regex + self.regexPattern = regexPattern ?? BlockchainType.Ethereum.regexPattern if let version = version { self.isPrimaryChain = CoinRecord.primaryChainsMap[ticker] == version } else { diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/CoinRegexPattern.swift b/unstoppable-ios-app/domains-manager-ios/Entities/CoinRegexPattern.swift deleted file mode 100644 index 391c7f17a..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Entities/CoinRegexPattern.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// CoinRegexPattern.swift -// domains-manager-ios -// -// Created by Oleg Kuplin on 24.06.2024. -// - -import Foundation - -enum CoinRegexPattern: String, CaseIterable { - case ETH - case SOL - case BTC -} - -extension CoinRegexPattern { - var regex: String { - switch self { - case .ETH: "^0x[a-fA-F0-9]{40}$" - case .SOL: "^[1-9A-HJ-NP-Za-km-z]{32,44}$" - case .BTC: "^bc1[ac-hj-np-z02-9]{6,87}$|^[13][a-km-zA-HJ-NP-Z1-9]{25,39}$" - } - } - - func isStringMatchingRegex(_ string: String) -> Bool { - let predicate = NSPredicate(format: "SELF MATCHES %@", regex) - - return predicate.evaluate(with: string) - } -} diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+SendCrypto.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+SendCrypto.swift index 6a1f668dd..1a76c4ea8 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+SendCrypto.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Mock/MockEntitiesFabric+SendCrypto.swift @@ -17,7 +17,7 @@ extension MockEntitiesFabric { static func mockReceiver() -> SendCryptoAsset.AssetReceiver { .init(walletAddress: Wallet.mockEntities()[1].address, - regexPattern: .ETH) + network: .Ethereum) } } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift index b9e26f6c0..d7b072fb2 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift @@ -158,7 +158,6 @@ extension BlockchainType { resolveChain(env: env).id } - var chainIcon: UIImage { switch self { case .Ethereum: @@ -174,3 +173,27 @@ extension BlockchainType { } } } + +extension BlockchainType { + var isEVMNetwork: Bool { + switch self { + case .Ethereum, .Matic, .Base: true + case .Bitcoin: false + case .Solana: false + } + } + + var regexPattern: String { + switch self { + case .Ethereum, .Matic, .Base: "^0x[a-fA-F0-9]{40}$" + case .Bitcoin: "^bc1[ac-hj-np-z02-9]{6,87}$|^[13][a-km-zA-HJ-NP-Z1-9]{25,39}$" + case .Solana: "^[1-9A-HJ-NP-Za-km-z]{32,44}$" + } + } + + func isStringMatchingRegex(_ string: String) -> Bool { + let predicate = NSPredicate(format: "SELF MATCHES %@", regexPattern) + + return predicate.evaluate(with: string) + } +} diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift index cd05dbe9d..6a6e4f916 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift @@ -83,24 +83,12 @@ private extension SelectCryptoAssetToSendView { } // raw address - - guard let blockchainType = token.blockchainType else { + guard let blockchainType = token.blockchainType, + blockchainType.regexPattern == receiver.network.regexPattern else { return nil } - switch blockchainType { - case .Ethereum, .Matic, .Base: // EVM - guard receiver.regexPattern == .ETH else { - Debugger.printFailure("Wrong regex pattern: \(receiver.regexPattern) for chain: \(String(describing: token.blockchainType?.fullName))") - return nil } - return BalanceTokenToSend(token: token, address: receiver.walletAddress) - case .Bitcoin, .Solana: - guard token.symbol == receiver.regexPattern.rawValue, - token.parent == nil else { // native coin not a token - return nil - } - return BalanceTokenToSend(token: token, address: receiver.walletAddress) - } + return BalanceTokenToSend(token: token, address: receiver.walletAddress) } struct BalanceTokenToSend: Identifiable { @@ -126,7 +114,7 @@ private extension SelectCryptoAssetToSendView { @ViewBuilder func assetTypePickerView() -> some View { - if case .ETH = receiver.regexPattern { + if receiver.network.isEVMNetwork { VStack(alignment: .leading, spacing: 20) { UDTabsPickerView(selectedTab: $selectedType, tabs: SendCryptoAsset.AssetType.allCases) diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectReceiver/SendCryptoAssetSelectReceiverView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectReceiver/SendCryptoAssetSelectReceiverView.swift index 3e6b85020..d1d79e3e6 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectReceiver/SendCryptoAssetSelectReceiverView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectReceiver/SendCryptoAssetSelectReceiverView.swift @@ -242,7 +242,7 @@ private extension SendCryptoAssetSelectReceiverView { rightViewStyle: nil) }, callback: { logAnalytic(event: .searchWalletAddressPressed, parameters: [.wallet : addressDetails.address, - .coin : addressDetails.regexPattern.rawValue]) + .coin : addressDetails.network.shortCode]) viewModel.handleAction(.globalWalletAddressSelected(addressDetails)) }) } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAsset.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAsset.swift index 700e0b1b5..ff0b9e908 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAsset.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAsset.swift @@ -56,7 +56,7 @@ extension SendCryptoAsset { extension SendCryptoAsset { struct AssetReceiver: Hashable { let walletAddress: String - let regexPattern: CoinRegexPattern + let network: BlockchainType let domainName: DomainName? private(set) var pfpURL: URL? private var records: [String: String] = [:] @@ -89,7 +89,7 @@ extension SendCryptoAsset { self.walletAddress = wallet.address self.domainName = wallet.rrDomain?.name self.pfpURL = wallet.rrDomain?.pfpSource.value.asURL - self.regexPattern = .ETH + self.network = .Ethereum try await loadRecords() } @@ -97,7 +97,7 @@ extension SendCryptoAsset { self.walletAddress = profile.ownerWallet self.domainName = profile.domainName self.pfpURL = profile.pfpURL - self.regexPattern = .ETH + self.network = .Ethereum try await loadRecords() } @@ -109,16 +109,16 @@ extension SendCryptoAsset { self.walletAddress = walletAddress self.domainName = globalProfile.name self.pfpURL = globalProfile.imagePath?.asURL - self.regexPattern = .ETH + self.network = .Ethereum try await loadRecords() } init(walletAddress: HexAddress, - regexPattern: CoinRegexPattern) { + network: BlockchainType) { self.walletAddress = walletAddress self.domainName = nil self.pfpURL = nil - self.regexPattern = regexPattern + self.network = network } mutating private func loadRecords() async throws { @@ -203,7 +203,7 @@ extension SendCryptoAsset { extension SendCryptoAsset { struct WalletAddressDetails { let address: String - let regexPattern: CoinRegexPattern + let network: BlockchainType } } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAssetViewModel.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAssetViewModel.swift index e77616cad..bdc816a26 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAssetViewModel.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoAssetViewModel.swift @@ -46,7 +46,7 @@ final class SendCryptoAssetViewModel: ObservableObject { navPath.append(.selectAssetToSend(receiver)) case .globalWalletAddressSelected(let addressDetails): navPath.append(.selectAssetToSend(.init(walletAddress: addressDetails.address, - regexPattern: addressDetails.regexPattern))) + network: addressDetails.network))) // Send crypto case .userTokenToSendSelected(let data): @@ -176,15 +176,15 @@ final class SendCryptoAssetViewModel: ObservableObject { } func getWalletAddressDetailsFor(address: String) -> SendCryptoAsset.WalletAddressDetails? { - let availableCoins: [CoinRegexPattern] + let availableNetworks: [BlockchainType] if sourceWallet.displayInfo.source == .mpc { - availableCoins = CoinRegexPattern.allCases + availableNetworks = BlockchainType.allCases } else { - availableCoins = [.ETH] + availableNetworks = [.Ethereum] } - if let coin = availableCoins.first(where: { $0.isStringMatchingRegex(address) }) { - return .init(address: address, regexPattern: coin) + if let network = availableNetworks.first(where: { $0.isStringMatchingRegex(address) }) { + return .init(address: address, network: network) } return nil } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoQRWalletAddressScannerView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoQRWalletAddressScannerView.swift index e83b1b537..b861d7279 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoQRWalletAddressScannerView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoQRWalletAddressScannerView.swift @@ -63,7 +63,7 @@ private extension SendCryptoQRWalletAddressScannerView { didRecognizeAddress = true logAnalytic(event: .didRecognizeQRWalletAddress, parameters: [.wallet: addressDetails.address, - .coin: addressDetails.regexPattern.rawValue]) + .coin: addressDetails.network.shortCode]) dismiss() Vibration.success.vibrate() DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) { diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoReceiverInfoTitleView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoReceiverInfoTitleView.swift index 4da293dc3..a13fc33a1 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoReceiverInfoTitleView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SendCryptoReceiverInfoTitleView.swift @@ -55,5 +55,5 @@ private extension SendCryptoReceiverInfoTitleView { #Preview { SendCryptoReceiverInfoTitleView(receiver: .init(walletAddress: "0x1234567890abcdef1234567890abcdef12345678", - regexPattern: .ETH)) + network: .Ethereum)) } From e394aec810da6368bc13b05c4166542fa646a986 Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 14:47:07 +0300 Subject: [PATCH 2/7] Cleaning --- .../domains-manager-ios/Entities/Debugger.swift | 3 ++- .../Extensions/Extension-String+Preview.swift | 1 + .../Fireblocks+UD/FB_UD_MPCConnectionService.swift | 2 +- .../AnalyticsService/AnalyticsServiceEnvironment.swift | 1 + .../PullUp/PullUpViewService+ExternalWallets.swift | 7 +++---- .../Services/PullUp/PullUpViewService.swift | 7 ++++--- .../Localization/en.lproj/Localizable.strings | 1 + 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift index af98bf0ba..1f8f4c222 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift @@ -39,6 +39,7 @@ public struct Debugger { case Messaging = "MS" case Debug = "DEBUG" case NFT = "NFT" + case mpc = "MPC" } enum DebugTopicsSet { @@ -60,7 +61,7 @@ public struct Debugger { case .debugUI: return [.Error, .Navigation, .UI, .Images, .Debug] case .debugNetwork: - return [.Network, .WebSockets, .Error, .Debug] + return [.Network, .WebSockets, .Error, .Debug, .mpc] case .custom(let topics): return topics } diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift index 3a7fc3474..a810f9f0d 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift @@ -244,6 +244,7 @@ extension String { static let confirmEmail = "CONFIRM_EMAIL" static let setup = "SETUP" static let networkFee = "NETWORK_FEE" + static let reconnect = "RECONNECT" //Onboarding static let alreadyMintedDomain = "ALREADY_MINTED_DOMAIN" diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/MPC/MPCWalletsService/MPCWalletSubServices/Fireblocks+UD/FB_UD_MPCConnectionService.swift b/unstoppable-ios-app/domains-manager-ios/Modules/MPC/MPCWalletsService/MPCWalletSubServices/Fireblocks+UD/FB_UD_MPCConnectionService.swift index 146a8d235..78ffaf1f4 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/MPC/MPCWalletsService/MPCWalletSubServices/Fireblocks+UD/FB_UD_MPCConnectionService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/MPC/MPCWalletsService/MPCWalletSubServices/Fireblocks+UD/FB_UD_MPCConnectionService.swift @@ -9,7 +9,7 @@ import Foundation func logMPC(_ message: String) { #if DEBUG - print("MPC: - \(message)") + Debugger.printInfo(topic: .mpc, message) #endif } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift b/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift index c57b5bb4f..ded8b6f60 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/AnalyticsService/AnalyticsServiceEnvironment.swift @@ -444,6 +444,7 @@ extension Analytics { case reEnterPasscode, reEnterPassword case useDifferentEmail, useRecovery, dontUseRecovery case contactSupport + case reconnect } } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService+ExternalWallets.swift b/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService+ExternalWallets.swift index 0c5f9be60..fc7468c30 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService+ExternalWallets.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService+ExternalWallets.swift @@ -262,10 +262,9 @@ extension PullUpViewService { contentAlignment: .center, icon: .init(icon: icon, size: .large), - // TODO: - set title, icon, analytics name - actionButton: .main(content: .init(title: "Reconnect", - icon: .appleIcon, - analyticsName: .domainRecord, + actionButton: .main(content: .init(title: String.Constants.reconnect.localized(), + icon: nil, + analyticsName: .reconnect, action: { completion(true) })), cancelButton: .gotItButton()), items: PullUpSelectionViewEmptyItem.allCases) diff --git a/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService.swift b/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService.swift index 29bd20283..dc1ea47bb 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/PullUp/PullUpViewService.swift @@ -368,18 +368,19 @@ extension PullUpViewService: PullUpViewServiceProtocol { let selectionViewHeight: CGFloat let icon = UIImage.getNetworkLargeIcon(by: chain)! let description: String - switch chain { // TODO: logic in the View + switch chain { case .Ethereum: description = String.Constants.mintedOnEthereumDescription.localized() selectionViewHeight = 328 case .Matic: description = String.Constants.mintedOnPolygonDescription.localized() selectionViewHeight = 304 - default: Debugger.printFailure("Minting can be only on Ethereum and Polygon", critical: true) + case .Base, .Bitcoin, .Solana: + Debugger.printFailure("Minting can be only on Ethereum and Polygon", critical: true) description = "\(chain.fullName) should not be used for minting" selectionViewHeight = 304 - } + let selectionView = PullUpSelectionView(configuration: .init(title: .text(chain.fullName), contentAlignment: .center, icon: .init(icon: icon, diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings index e36fcc7d9..5e28295a7 100644 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings @@ -182,6 +182,7 @@ "CONFIRM_EMAIL" = "Confirm email"; "SETUP" = "Setup"; "NETWORK_FEE" = "Network Fee"; +"RECONNECT" = "Reconnect"; /* ONBOARDING */ // Tutorial screens From 3b8583d82a38015c8fbd8825bf15a7f31a47658b Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 15:57:42 +0300 Subject: [PATCH 3/7] Cleaning --- .../Entities/PreviewUDWallet.swift | 2 +- .../Extensions/UISearchBar.swift | 51 ------------- .../DomainProfileSectionHeader.swift | 6 +- .../DomainProfilePendingChanges.swift | 14 ++-- ...inProfileViewControllerItemsEntities.swift | 76 +++++++++++-------- .../PublicProfileFollowersView.swift | 73 +++++++++--------- .../Home/Activity/HomeActivityViewModel.swift | 2 +- .../Home/NFTDetailsView/NFTDetailsView.swift | 33 ++++---- .../CryptoSender/EVMCryptoSender.swift | 13 +++- .../SelectCryptoAssetToSendView.swift | 5 +- .../ReconnectMPCWalletViewModel.swift | 2 +- .../Tutorial/TutorialViewController.swift | 5 +- .../NetworkService+ProfilesEntities.swift | 8 +- .../ConnectLineSectionView.swift | 8 +- 14 files changed, 146 insertions(+), 152 deletions(-) delete mode 100644 unstoppable-ios-app/domains-manager-ios/Extensions/UISearchBar.swift diff --git a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewUDWallet.swift b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewUDWallet.swift index abaf0c231..547253d44 100644 --- a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewUDWallet.swift +++ b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewUDWallet.swift @@ -58,7 +58,7 @@ struct UDWallet: Codable, Hashable { } static func == (lhs: UDWallet, rhs: UDWallet) -> Bool { - let resultEth = (lhs.address == rhs.address) && lhs.address != nil + let resultEth = (lhs.address == rhs.address) return resultEth } diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/UISearchBar.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/UISearchBar.swift deleted file mode 100644 index 3897f2e04..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/UISearchBar.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// UISearchBar.swift -// domains-manager-ios -// -// Created by Oleg Kuplin on 03.05.2022. -// - -import UIKit - -extension UISearchBar { - func applyUDStyle() { - let clearIcon = UIImage.searchClearIcon.withTintColor(.foregroundMuted) - UISearchBar.appearance().setImage(clearIcon, for: .clear, state: .normal) - UISearchBar.appearance().setImage(clearIcon, for: .clear, state: .highlighted) - - if let clearButton = searchTextField.value(forKey: "_clearButton") as? UIButton { - clearButton.tintColor = .foregroundMuted - } - - backgroundColor = .clear - backgroundImage = nil - searchBarStyle = .minimal - - searchTextField.tintColor = .foregroundAccent - searchTextField.textColor = .foregroundDefault - searchTextField.backgroundColor = .backgroundSubtle - searchTextField.background = nil - searchTextField.borderStyle = .none - searchTextField.layer.cornerRadius = 12 - searchTextField.layer.masksToBounds = true - searchTextField.layer.borderWidth = 1 - searchTextField.layer.borderColor = UIColor.borderDefault.cgColor - searchTextField.clipsToBounds = true - searchTextField.attributedPlaceholder = NSAttributedString(string: String.Constants.search.localized(), - attributes: [.foregroundColor : UIColor.foregroundSecondary, - .font : UIFont.currentFont(withSize: 16, weight: .regular)]) - - let searchIconImageView = UIImageView(frame: CGRect(x: 6, y: 0, width: 20, height: 20)) - searchIconImageView.image = UIImage(named: "searchIcon") - searchIconImageView.contentMode = .center - searchIconImageView.tintColor = .foregroundSecondary - let searchContainer = UIView(frame: CGRect(x: 0, y: 0, width: 30, height: 20)) - searchContainer.addSubview(searchIconImageView) - - searchTextField.textContentType = .oneTimeCode - searchTextField.spellCheckingType = .no - - searchTextField.leftView = searchContainer - searchTextField.leftViewMode = .always - } -} diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/CollectionReusableViews/DomainProfileSectionHeader.swift b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/CollectionReusableViews/DomainProfileSectionHeader.swift index 88ce8e8f9..57a2fcb56 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/CollectionReusableViews/DomainProfileSectionHeader.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/CollectionReusableViews/DomainProfileSectionHeader.swift @@ -147,7 +147,11 @@ extension DomainProfileSectionHeader { nonisolated static func == (lhs: Self, rhs: Self) -> Bool { - lhs.title == rhs.title && lhs.icon == rhs.icon && lhs.isEnabled == rhs.isEnabled + guard lhs.title == rhs.title else { return false } + guard lhs.icon == rhs.icon else { return false } + guard lhs.isEnabled == rhs.isEnabled else { return false } + + return true } nonisolated diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfilePendingChanges.swift b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfilePendingChanges.swift index 2381cdd2d..463c61781 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfilePendingChanges.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfilePendingChanges.swift @@ -17,12 +17,14 @@ struct DomainProfilePendingChanges: Codable, Hashable { var website: String? = nil var isEmpty: Bool { - avatarData == nil && - bannerData == nil && - name == nil && - bio == nil && - location == nil && - website == nil + guard avatarData == nil else { return false } + guard bannerData == nil else { return false } + guard name == nil else { return false } + guard bio == nil else { return false } + guard location == nil else { return false } + guard website == nil else { return false } + + return true } var updateAttributes: ProfileUpdateRequest.AttributeSet { diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfileViewControllerItemsEntities.swift b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfileViewControllerItemsEntities.swift index fd202968f..5c906d3eb 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfileViewControllerItemsEntities.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Entities/DomainProfileViewControllerItemsEntities.swift @@ -64,14 +64,16 @@ extension DomainProfileViewController { } static func == (lhs: Self, rhs: Self) -> Bool { - lhs.id == rhs.id && - lhs.domain == rhs.domain && - lhs.social == rhs.social && - lhs.isEnabled == rhs.isEnabled && - lhs.avatarImageState == rhs.avatarImageState && - lhs.bannerImageState == rhs.bannerImageState && - lhs.bannerImageActions == rhs.bannerImageActions && - lhs.avatarImageActions == rhs.avatarImageActions + guard lhs.id == rhs.id else { return false } + guard lhs.domain == rhs.domain else { return false } + guard lhs.social == rhs.social else { return false } + guard lhs.isEnabled == rhs.isEnabled else { return false } + guard lhs.avatarImageState == rhs.avatarImageState else { return false } + guard lhs.bannerImageState == rhs.bannerImageState else { return false } + guard lhs.bannerImageActions == rhs.bannerImageActions else { return false } + guard lhs.avatarImageActions == rhs.avatarImageActions else { return false } + + return true } func hash(into hasher: inout Hasher) { @@ -102,13 +104,15 @@ extension DomainProfileViewController { let removeCoinCallback: MainActorAsyncCallback static func == (lhs: Self, rhs: Self) -> Bool { - lhs.coin == rhs.coin && - lhs.address == rhs.address && - lhs.multiChainAddressesCount == rhs.multiChainAddressesCount && - lhs.isEnabled == rhs.isEnabled && - lhs.error == rhs.error && - lhs.mode == rhs.mode && - lhs.availableActions == rhs.availableActions + guard lhs.coin == rhs.coin else { return false } + guard lhs.address == rhs.address else { return false } + guard lhs.multiChainAddressesCount == rhs.multiChainAddressesCount else { return false } + guard lhs.isEnabled == rhs.isEnabled else { return false } + guard lhs.error == rhs.error else { return false } + guard lhs.mode == rhs.mode else { return false } + guard lhs.availableActions == rhs.availableActions else { return false } + + return true } func hash(into hasher: inout Hasher) { @@ -210,13 +214,15 @@ extension DomainProfileViewController { let lockButtonPressedCallback: MainActorAsyncCallback static func == (lhs: Self, rhs: Self) -> Bool { - lhs.id == rhs.id && - lhs.type == rhs.type && - lhs.isEnabled == rhs.isEnabled && - lhs.isPublic == rhs.isPublic && - lhs.error == rhs.error && - lhs.mode == rhs.mode && - lhs.availableActions == rhs.availableActions + guard lhs.id == rhs.id else { return false } + guard lhs.type == rhs.type else { return false } + guard lhs.isEnabled == rhs.isEnabled else { return false } + guard lhs.isPublic == rhs.isPublic else { return false } + guard lhs.error == rhs.error else { return false } + guard lhs.mode == rhs.mode else { return false } + guard lhs.availableActions == rhs.availableActions else { return false } + + return true } func hash(into hasher: inout Hasher) { @@ -241,10 +247,12 @@ extension DomainProfileViewController { let actionButtonPressedCallback: MainActorAsyncCallback static func == (lhs: Self, rhs: Self) -> Bool { - lhs.id == rhs.id && - lhs.description == rhs.description && - lhs.isEnabled == rhs.isEnabled && - lhs.availableActions == rhs.availableActions + guard lhs.id == rhs.id else { return false } + guard lhs.description == rhs.description else { return false } + guard lhs.isEnabled == rhs.isEnabled else { return false } + guard lhs.availableActions == rhs.availableActions else { return false } + + return true } func hash(into hasher: inout Hasher) { @@ -278,9 +286,11 @@ extension DomainProfileViewController { let actionButtonPressedCallback: MainActorAsyncCallback static func == (lhs: Self, rhs: Self) -> Bool { - lhs.id == rhs.id && - lhs.isEnabled == rhs.isEnabled && - lhs.type == rhs.type + guard lhs.id == rhs.id else { return false } + guard lhs.isEnabled == rhs.isEnabled else { return false } + guard lhs.type == rhs.type else { return false } + + return true } func hash(into hasher: inout Hasher) { @@ -301,9 +311,11 @@ extension DomainProfileViewController { let actionButtonPressedCallback: MainActorAsyncCallback static func == (lhs: Self, rhs: Self) -> Bool { - lhs.id == rhs.id && - lhs.web3Url == rhs.web3Url && - lhs.domainName == rhs.domainName + guard lhs.id == rhs.id else { return false } + guard lhs.web3Url == rhs.web3Url else { return false } + guard lhs.domainName == rhs.domainName else { return false } + + return true } func hash(into hasher: inout Hasher) { diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/FollowersView/PublicProfileFollowersView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/FollowersView/PublicProfileFollowersView.swift index dcf5fc192..71538af6b 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/FollowersView/PublicProfileFollowersView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/DomainProfile/Public Profile/FollowersView/PublicProfileFollowersView.swift @@ -46,41 +46,7 @@ struct PublicProfileFollowersView: View, ViewAnalyticsLogger { if let currentFollowersList = viewModel.currentFollowersList, !currentFollowersList.isEmpty { - ScrollViewReader { proxy in - List(getCurrentPublishedFollowersList() ?? [], id: \.domain) { follower in - Button { - followerSelected(follower) - } label: { - rowForFollower(follower) - } - .listRowSeparator(.hidden) - .unstoppableListRowInset() - .onAppear { - viewModel.loadMoreContentIfNeeded(currentFollower: follower) - } - - if viewModel.isLoadingPage, - follower == currentFollowersList.last { - HStack { - Spacer() - ProgressView() - Spacer() - } - .listRowSeparator(.hidden) - .listRowBackground(Color.clear) - } - } - .onChange(of: viewModel.selectedType) { selectedType in - proxy.scrollTo(currentFollowersList.first, anchor: .top) - logButtonPressedAnalyticEvents(button: .followerType, parameters: [.value: selectedType.rawValue]) - } - } - - .offset(y: -8) - .background(.clear) - .clearListBackground() - .ignoresSafeArea() - + currentFollowersListView(currentFollowersList) } else { Spacer() } @@ -148,6 +114,43 @@ private extension PublicProfileFollowersView { // MARK: - Private methods private extension PublicProfileFollowersView { + @ViewBuilder + func currentFollowersListView(_ currentFollowersList: [DomainProfileFollowerDisplayInfo]) -> some View { + ScrollViewReader { proxy in + List(getCurrentPublishedFollowersList() ?? [], id: \.domain) { follower in + Button { + followerSelected(follower) + } label: { + rowForFollower(follower) + } + .listRowSeparator(.hidden) + .unstoppableListRowInset() + .onAppear { + viewModel.loadMoreContentIfNeeded(currentFollower: follower) + } + + if viewModel.isLoadingPage, + follower == currentFollowersList.last { + HStack { + Spacer() + ProgressView() + Spacer() + } + .listRowSeparator(.hidden) + .listRowBackground(Color.clear) + } + } + .onChange(of: viewModel.selectedType) { selectedType in + proxy.scrollTo(currentFollowersList.first, anchor: .top) + logButtonPressedAnalyticEvents(button: .followerType, parameters: [.value: selectedType.rawValue]) + } + } + .offset(y: -8) + .background(.clear) + .clearListBackground() + .ignoresSafeArea() + } + @ViewBuilder func rowForFollower(_ follower: DomainProfileFollowerDisplayInfo) -> some View { HStack(spacing: 16) { diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/HomeActivityViewModel.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/HomeActivityViewModel.swift index decbfb937..4a18fcc9e 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/HomeActivityViewModel.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/HomeActivityViewModel.swift @@ -103,7 +103,7 @@ private extension HomeActivityViewModel { } func loadTxsForSelectedProfile(forceReload: Bool) async { - guard case .wallet(let wallet) = selectedProfile else { return } + guard case .wallet = selectedProfile else { return } isLoadingMore = true do { diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/NFTDetailsView/NFTDetailsView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/NFTDetailsView/NFTDetailsView.swift index 2f02d3f11..f864aed1f 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/NFTDetailsView/NFTDetailsView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/NFTDetailsView/NFTDetailsView.swift @@ -21,19 +21,7 @@ struct NFTDetailsView: View, ViewAnalyticsLogger { var body: some View { NavigationViewWithCustomTitle(content: { - OffsetObservingScrollView(showsIndicators: false, offset: $scrollOffset) { - VStack(spacing: 20) { - nftImageView() - nftCollectionInfoView() - separatorView() - nftPriceInfoView() - separatorView() - nftDescriptionInfoView() - nftTraitsSectionView() - nftOtherDetailsSectionView() - } - .padding() - } + contentScrollView() .onChange(of: scrollOffset) { newValue in withAnimation { navigationState?.isTitleVisible = newValue.y > UIScreen.main.bounds.width + 60 @@ -107,6 +95,23 @@ private extension NFTDetailsView { } } + @ViewBuilder + func contentScrollView() -> some View { + OffsetObservingScrollView(showsIndicators: false, offset: $scrollOffset) { + VStack(spacing: 20) { + nftImageView() + nftCollectionInfoView() + separatorView() + nftPriceInfoView() + separatorView() + nftDescriptionInfoView() + nftTraitsSectionView() + nftOtherDetailsSectionView() + } + .padding() + } + } + @ViewBuilder func nftImageView() -> some View { ZStack { @@ -406,7 +411,7 @@ private extension NFTDetailsView { var analyticsName: Analytics.Button { switch self { - case .savePhoto(let uIImage): + case .savePhoto: return .savePhoto case .refresh: return .refresh diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/CryptoSender/EVMCryptoSender.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/CryptoSender/EVMCryptoSender.swift index ac422642e..7dee83631 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/CryptoSender/EVMCryptoSender.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/CryptoSender/EVMCryptoSender.swift @@ -92,9 +92,16 @@ struct NativeCoinCryptoSender: ConcreteCryptoSenderProtocol, EVMCryptoSender { func canSendCrypto(token: CryptoSender.SupportedToken, chain chainSpec: ChainSpec) -> Bool { // only native tokens supported - return (token == CryptoSender.SupportedToken.eth && chainSpec.chain.identifyBlockchainType() == .Ethereum) || - (token == CryptoSender.SupportedToken.matic && chainSpec.chain.identifyBlockchainType() == .Matic) || - (token == CryptoSender.SupportedToken.eth && chainSpec.chain.identifyBlockchainType() == .Base) + switch (token, chainSpec.chain.identifyBlockchainType()) { + case (.eth, .Ethereum): + return true + case (.matic, .Matic): + return true + case (.eth, .Base): + return true + default: + return false + } } internal func createSendTransaction(crypto: CryptoSendingSpec, diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift index 6a6e4f916..ab4057dfe 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/SendCryptoAsset/SelectAssetToSend/SelectCryptoAssetToSendView.swift @@ -56,15 +56,16 @@ private extension SelectCryptoAssetToSendView { Task { let currencies = await appContext.coinRecordsService.getCurrencies() - let tokens = viewModel.sourceWallet.balance + let balanceTokensDescriptions: [BalanceTokenUIDescription] = viewModel.sourceWallet.balance .map { BalanceTokenUIDescription.extractFrom(walletBalance: $0) } .flatMap({ $0 }) + let filteredBalanceTokensDescriptions = balanceTokensDescriptions .filter { viewModel.canSendToken($0) } .filter { $0.balanceUsd > 0 } .sorted(by: { lhs, rhs in lhs.balanceUsd > rhs.balanceUsd }) - .compactMap { createTokenToSendFrom(token: $0, in: currencies) } + let tokens: [BalanceTokenToSend] = filteredBalanceTokensDescriptions.compactMap { createTokenToSendFrom(token: $0, in: currencies) } self.notAddedTokens = tokens.filter { $0.address == nil } self.tokens = tokens.filter { $0.address != nil } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/MPC/Activate/ReconnectMPCWalletFlow/ReconnectMPCWalletViewModel.swift b/unstoppable-ios-app/domains-manager-ios/Modules/MPC/Activate/ReconnectMPCWalletFlow/ReconnectMPCWalletViewModel.swift index ba4487949..68a39b6cf 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/MPC/Activate/ReconnectMPCWalletFlow/ReconnectMPCWalletViewModel.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/MPC/Activate/ReconnectMPCWalletFlow/ReconnectMPCWalletViewModel.swift @@ -43,7 +43,7 @@ final class ReconnectMPCWalletViewModel: ObservableObject { guard let credentials else { return } navPath.append(.activate(credentials: credentials, code: code)) - case .didActivate(let wallet): + case .didActivate: navigationState?.dismiss = true reconnectResultCallback(.reconnected) case .didRequestToChangeEmail: diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Onboarding/Tutorial/TutorialViewController.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Onboarding/Tutorial/TutorialViewController.swift index 3cb2ad59b..a248cb772 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Onboarding/Tutorial/TutorialViewController.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Onboarding/Tutorial/TutorialViewController.swift @@ -291,7 +291,10 @@ private extension TutorialViewController { func setupNavProgressViewFrame() { guard let navBar = cNavigationBar else { return } - progressView.frame.origin.y = navBar.bounds.height - (navBar.navBarContentView.bounds.height / 2) - (progressView.frame.height / 2) + let navBarHeight: CGFloat = navBar.bounds.height + let contentHeightHalf: CGFloat = navBar.navBarContentView.bounds.height / 2 + let progressViewHalf: CGFloat = progressView.frame.height / 2 + progressView.frame.origin.y = navBarHeight - contentHeightHalf - progressViewHalf } func setupDisplayLink() { diff --git a/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift b/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift index 26f0173dd..0326197c9 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService+ProfilesEntities.swift @@ -659,7 +659,13 @@ struct WalletTokenPortfolio: Codable, Hashable { let logoUrl: String? var totalTokensBalance: Double { - (value.walletUsdAmt ?? 0) + (tokens?.reduce(0.0, { $0 + ($1.value?.walletUsdAmt ?? 0) }) ?? 0) + let coinAmount = value.walletUsdAmt ?? 0 + if let tokens { + let tokensAmount = tokens.reduce(0.0, { $0 + ($1.value?.walletUsdAmt ?? 0) }) + + return coinAmount + tokensAmount + } + return coinAmount } struct NFT: Codable, Hashable { diff --git a/unstoppable-ios-app/domains-manager-ios/SwiftUI/CommonViews/ConnectCurveLine/ConnectLineSectionView.swift b/unstoppable-ios-app/domains-manager-ios/SwiftUI/CommonViews/ConnectCurveLine/ConnectLineSectionView.swift index 772f69150..30d342bd1 100644 --- a/unstoppable-ios-app/domains-manager-ios/SwiftUI/CommonViews/ConnectCurveLine/ConnectLineSectionView.swift +++ b/unstoppable-ios-app/domains-manager-ios/SwiftUI/CommonViews/ConnectCurveLine/ConnectLineSectionView.swift @@ -142,9 +142,11 @@ extension ConnectLineSectionView { static func == (lhs: ConnectLineSectionView.InfoActionDescription, rhs: ConnectLineSectionView.InfoActionDescription) -> Bool { - lhs.title == rhs.title && - lhs.subtitle == rhs.subtitle && - lhs.iconName == rhs.iconName + guard lhs.title == rhs.title else { return false } + guard lhs.subtitle == rhs.subtitle else { return false } + guard lhs.iconName == rhs.iconName else { return false } + + return true } func hash(into hasher: inout Hasher) { From c206913dd51cdd439dae0af2adc41b8575e6cccd Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 15:58:10 +0300 Subject: [PATCH 4/7] Add flags to measure type-checking performance --- .../domains-manager-ios.xcodeproj/project.pbxproj | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj index a693963ad..78afeeee8 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj @@ -466,7 +466,6 @@ C61C333A2B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C33392B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift */; }; C61C333B2B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C33392B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift */; }; C61C50002820E39600D1110A /* PullUpSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C4FFF2820E39600D1110A /* PullUpSelectionView.swift */; }; - C61C50052820FC5E00D1110A /* UISearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C50042820FC5E00D1110A /* UISearchBar.swift */; }; C61DB0FE2B95872500CDA243 /* PublicProfileLargeTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61DB0FD2B95872500CDA243 /* PublicProfileLargeTextView.swift */; }; C61DB0FF2B95872900CDA243 /* PublicProfileLargeTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61DB0FD2B95872500CDA243 /* PublicProfileLargeTextView.swift */; }; C61DB1052B95879200CDA243 /* PublicProfilePrimaryLargeTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61DB1042B95879200CDA243 /* PublicProfilePrimaryLargeTextView.swift */; }; @@ -2326,7 +2325,6 @@ C6D647542B1EDBAE00D724AC /* WalletInfoBadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6ECBF8A28D2D20900E94309 /* WalletInfoBadgeView.swift */; }; C6D647552B1EDBAE00D724AC /* WalletInfoBadgeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C6ECBF8F28D2D20D00E94309 /* WalletInfoBadgeView.xib */; }; C6D647562B1EDBF800D724AC /* UserProfileAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C666E0FB29CD594F0003DECB /* UserProfileAction.swift */; }; - C6D647572B1EDC1600D724AC /* UISearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C61C50042820FC5E00D1110A /* UISearchBar.swift */; }; C6D647582B1EDC1C00D724AC /* CollectionTextHeaderReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C68953912834CD280046CBA3 /* CollectionTextHeaderReusableView.swift */; }; C6D647592B1EDC2E00D724AC /* TertiaryButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6668945281151F6002062B4 /* TertiaryButton.swift */; }; C6D6475B2B1EDCED00D724AC /* PreviewDomainProfileInfoStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6D6475A2B1EDCED00D724AC /* PreviewDomainProfileInfoStorage.swift */; }; @@ -3005,7 +3003,6 @@ C61C332C2B906DCE00BD11F5 /* MockEntitiesFabric+Explore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MockEntitiesFabric+Explore.swift"; sourceTree = ""; }; C61C33392B90CE6600BD11F5 /* MessagingChatUserDisplayInfoImageLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagingChatUserDisplayInfoImageLoader.swift; sourceTree = ""; }; C61C4FFF2820E39600D1110A /* PullUpSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PullUpSelectionView.swift; sourceTree = ""; }; - C61C50042820FC5E00D1110A /* UISearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UISearchBar.swift; sourceTree = ""; }; C61DB0FD2B95872500CDA243 /* PublicProfileLargeTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicProfileLargeTextView.swift; sourceTree = ""; }; C61DB1042B95879200CDA243 /* PublicProfilePrimaryLargeTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicProfilePrimaryLargeTextView.swift; sourceTree = ""; }; C61DB1072B9587B600CDA243 /* PublicProfileSecondaryLargeTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicProfileSecondaryLargeTextView.swift; sourceTree = ""; }; @@ -5357,7 +5354,6 @@ C628E36227FDDAA00044E408 /* UILabel.swift */, C6098319282B707B00546392 /* UINavigationController.swift */, C6E0415A295053DC0080F8E3 /* UIScrollView.swift */, - C61C50042820FC5E00D1110A /* UISearchBar.swift */, C6456F142800212000A517D5 /* UIStackView.swift */, C628E34E27FDB2A30044E408 /* UITableView.swift */, C6D6E53F28193851008C66BB /* UITableViewCell.swift */, @@ -9926,7 +9922,6 @@ C65272662A15DEB9001A084C /* KeyboardService.swift in Sources */, C6A2D51E284DBDF000327C47 /* QRScannerSightView.swift in Sources */, C69F99272A9F1264004B1958 /* AvatarStyleClipped.swift in Sources */, - C61C50052820FC5E00D1110A /* UISearchBar.swift in Sources */, C628E36827FDDB230044E408 /* UIButton.swift in Sources */, C696989A2ACBCE640000738C /* PushMessagingWebSocketsService.swift in Sources */, C63F1D0D28AF31D5000A5C12 /* AnalyticsServiceProtocol.swift in Sources */, @@ -11089,7 +11084,6 @@ C6D647A62B1F189B00D724AC /* PurchaseSearchDomainsViewController.swift in Sources */, C630C7372BD781E900AC1662 /* OnboardingAddWalletViewController.swift in Sources */, C6D645C62B1DBD3900D724AC /* CNavigationBarContentView.swift in Sources */, - C6D647572B1EDC1600D724AC /* UISearchBar.swift in Sources */, C68F156E2BD659740049BFA2 /* MPCActivateWalletEnterView.swift in Sources */, C6D647A72B1F18AE00D724AC /* HappyEndViewController.swift in Sources */, C61808722B19BC150032E543 /* Color.swift in Sources */, @@ -11531,6 +11525,7 @@ ); MARKETING_VERSION = 5.3.0; MERGED_BINARY_TYPE = automatic; + OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=50 -Xfrontend -warn-long-function-bodies=50"; PRODUCT_BUNDLE_IDENTIFIER = com.unstoppabledomains.manager; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -11565,6 +11560,7 @@ ); MARKETING_VERSION = 5.3.0; MERGED_BINARY_TYPE = automatic; + OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=50 -Xfrontend -warn-long-function-bodies=50"; PRODUCT_BUNDLE_IDENTIFIER = com.unstoppabledomains.manager; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -11741,6 +11737,7 @@ ); MARKETING_VERSION = 5.3.0; MERGED_BINARY_TYPE = automatic; + OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=50 -Xfrontend -warn-long-function-bodies=50"; PRODUCT_BUNDLE_IDENTIFIER = com.unstoppabledomains.manager; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; From 2d120965910cd480947b93145796c1eee02627fd Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 16:04:35 +0300 Subject: [PATCH 5/7] Fixing preview target --- .../AppContext/PreviewCoinRecordsService.swift | 6 +++--- .../Entities/PreviewDebugger.swift | 1 + .../Entities/PreviewDomainItem.swift | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewCoinRecordsService.swift b/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewCoinRecordsService.swift index c9286890b..a33303a9d 100644 --- a/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewCoinRecordsService.swift +++ b/unstoppable-ios-app/domains-manager-ios-preview/AppContext/PreviewCoinRecordsService.swift @@ -13,17 +13,17 @@ final class CoinRecordsService: CoinRecordsServiceProtocol { [.init(ticker: "ETH", version: nil, expandedTicker: "crypto.ETH", - regexPattern: CoinRegexPattern.ETH.regex, + regexPattern: BlockchainType.Ethereum.regexPattern, isDeprecated: false), .init(ticker: "MATIC", version: nil, expandedTicker: "crypto.MATIC", - regexPattern: CoinRegexPattern.ETH.regex, + regexPattern: BlockchainType.Matic.regexPattern, isDeprecated: false), .init(ticker: "BTC", version: nil, expandedTicker: "crypto.BTC.address", - regexPattern: CoinRegexPattern.BTC.regex, + regexPattern: BlockchainType.Bitcoin.regexPattern, isDeprecated: false)] } diff --git a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDebugger.swift b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDebugger.swift index 4e09ae6c2..bb6b98b4b 100644 --- a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDebugger.swift +++ b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDebugger.swift @@ -38,6 +38,7 @@ public struct Debugger { case Messaging = "MS" case Debug = "DEBUG" case NFT = "NFT" + case mpc = "MPC" } enum DebugTopicsSet { diff --git a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDomainItem.swift b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDomainItem.swift index 5a7383f80..6d9c89ce5 100644 --- a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDomainItem.swift +++ b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewDomainItem.swift @@ -14,8 +14,10 @@ struct DomainItem: DomainEntity { func doesRequirePayment() -> Bool { switch self.getBlockchainType() { - case .Ethereum, .Base: return true - case .Matic: return false + case .Ethereum: return true + + case .Matic, .Base, .Bitcoin, .Solana: + return false } } } From 596945fd4286f78068f1b0bbdd4a2f0302b29f87 Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 17:12:08 +0300 Subject: [PATCH 6/7] Add animation to mpc wallet card --- .../project.pbxproj | 6 + .../AnimatedMPCWalletGridMask.swift | 71 + .../MPCWalletStateCardView.swift | 1 + .../mpcWalletGridAccent.svg | 1184 ++++++++--------- 4 files changed, 670 insertions(+), 592 deletions(-) create mode 100644 unstoppable-ios-app/domains-manager-ios/Modules/MPC/PurchaseMPCFlow/AnimatedMPCWalletGridMask.swift diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj index 78afeeee8..da4c716dd 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj @@ -754,6 +754,8 @@ C63F1D0928AF31D5000A5C12 /* AnalyticsServiceEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = C63F1D0428AF31D5000A5C12 /* AnalyticsServiceEnvironment.swift */; }; C63F1D0D28AF31D5000A5C12 /* AnalyticsServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C63F1D0528AF31D5000A5C12 /* AnalyticsServiceProtocol.swift */; }; C63F1D1128AF31D5000A5C12 /* AnalyticsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C63F1D0628AF31D5000A5C12 /* AnalyticsService.swift */; }; + C640D6122C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift in Sources */ = {isa = PBXBuildFile; fileRef = C640D6112C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift */; }; + C640D6132C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift in Sources */ = {isa = PBXBuildFile; fileRef = C640D6112C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift */; }; C640F3552C06FC66009EB0F9 /* MPCWalletPasswordValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C640F3542C06FC66009EB0F9 /* MPCWalletPasswordValidator.swift */; }; C640F3562C06FC66009EB0F9 /* MPCWalletPasswordValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C640F3542C06FC66009EB0F9 /* MPCWalletPasswordValidator.swift */; }; C640F3582C06FCB6009EB0F9 /* MPCWalletPasswordValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C640F3572C06FCB6009EB0F9 /* MPCWalletPasswordValidatorTests.swift */; }; @@ -3230,6 +3232,7 @@ C63F1D0428AF31D5000A5C12 /* AnalyticsServiceEnvironment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnalyticsServiceEnvironment.swift; sourceTree = ""; }; C63F1D0528AF31D5000A5C12 /* AnalyticsServiceProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnalyticsServiceProtocol.swift; sourceTree = ""; }; C63F1D0628AF31D5000A5C12 /* AnalyticsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnalyticsService.swift; sourceTree = ""; }; + C640D6112C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedMPCWalletGridMask.swift; sourceTree = ""; }; C640F3542C06FC66009EB0F9 /* MPCWalletPasswordValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCWalletPasswordValidator.swift; sourceTree = ""; }; C640F3572C06FCB6009EB0F9 /* MPCWalletPasswordValidatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCWalletPasswordValidatorTests.swift; sourceTree = ""; }; C640F35B2C070718009EB0F9 /* MPCOnboardingPurchaseTakeoverRecoveryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPCOnboardingPurchaseTakeoverRecoveryViewController.swift; sourceTree = ""; }; @@ -7090,6 +7093,7 @@ C640F36B2C071266009EB0F9 /* MPCWalletTakeoverState.swift */, C640F36E2C0712A8009EB0F9 /* MPCWalletTakeoverError.swift */, C68F15752BD769830049BFA2 /* MPCWalletStateCardView.swift */, + C640D6112C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift */, C640F3542C06FC66009EB0F9 /* MPCWalletPasswordValidator.swift */, C66556682BF70B9900F0BD7A /* UDAuth */, C66556722BF70F6400F0BD7A /* Checkout */, @@ -9720,6 +9724,7 @@ C6FFBAE12B834EF700CB442D /* HomeChatNavigationDestination.swift in Sources */, C688C1A12B8490F700BD233A /* ChatRequestsListViewModel.swift in Sources */, C68BA7592BBD10AF00FF524C /* WalletTransactionTypeIndicatorView.swift in Sources */, + C640D6122C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift in Sources */, C6C9DEAE2834BD9300BAC36F /* CopyWalletAddressPullUpHandler.swift in Sources */, C623967C2A288A8A00363F60 /* MessagingChatMessageDisplayType.swift in Sources */, C6C57C3D2869C0890093FD8C /* UDDomainSharingWatchCardView.swift in Sources */, @@ -10835,6 +10840,7 @@ C6D646342B1DC43D00D724AC /* TextTertiaryButton.swift in Sources */, C61808322B19ADF10032E543 /* PreviewCoreAppCoordinator.swift in Sources */, C6B2E2002B96C51B00CEA1F9 /* MessagingChatMessageUnsupportedTypeDisplayInfo.swift in Sources */, + C640D6132C48087C006B21C3 /* AnimatedMPCWalletGridMask.swift in Sources */, C6D645AA2B1DBB3800D724AC /* UICollectionViewLayout.swift in Sources */, C6C8F9372B2183D100A9834D /* DomainImageDetailsViewPresenter.swift in Sources */, C6D6470D2B1ED7D000D724AC /* MessagingChatMessageDisplayInfo.swift in Sources */, diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/MPC/PurchaseMPCFlow/AnimatedMPCWalletGridMask.swift b/unstoppable-ios-app/domains-manager-ios/Modules/MPC/PurchaseMPCFlow/AnimatedMPCWalletGridMask.swift new file mode 100644 index 000000000..110f857cc --- /dev/null +++ b/unstoppable-ios-app/domains-manager-ios/Modules/MPC/PurchaseMPCFlow/AnimatedMPCWalletGridMask.swift @@ -0,0 +1,71 @@ +// +// AnimatedMPCWalletGridMask.swift +// domains-manager-ios +// +// Created by Oleg Kuplin on 17.07.2024. +// + +import SwiftUI + +struct AnimatedMPCWalletGridMask: View { + let numShapes: Int = 12 // Number of random shapes + let animationDuration: Double = 3.0 // Duration for fade in/out animation + + @State private var positions: [CGPoint] = [] + @State private var opacities: [Double] = [] + + init() { + // Initialize with random positions and opacities + var points: [CGPoint] = [] + var alphas: [Double] = [] + for _ in 0.. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d138115acd481b6f5f601fc81077b9925f531051 Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 17 Jul 2024 17:21:33 +0300 Subject: [PATCH 7/7] Cleaning --- .../Home/Wallet/HomeWalletView/HomeWalletViewModel.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/Wallet/HomeWalletView/HomeWalletViewModel.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/Wallet/HomeWalletView/HomeWalletViewModel.swift index 0dd5db0d3..21546a605 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/Wallet/HomeWalletView/HomeWalletViewModel.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/Wallet/HomeWalletView/HomeWalletViewModel.swift @@ -269,9 +269,9 @@ fileprivate extension HomeWalletView.HomeWalletViewModel { func ensureRRDomainRecordsMatchOwnerWallet() { Task { let walletAddress = selectedWallet.address - guard lastVerifiedRecordsWalletAddress != selectedWallet.address else { return } + guard lastVerifiedRecordsWalletAddress != walletAddress else { return } guard let rrDomain = selectedWallet.rrDomain else { - lastVerifiedRecordsWalletAddress = selectedWallet.address + lastVerifiedRecordsWalletAddress = walletAddress chainsNotMatch = [] return } @@ -327,7 +327,7 @@ fileprivate extension HomeWalletView.HomeWalletViewModel { } } - lastVerifiedRecordsWalletAddress = selectedWallet.address + lastVerifiedRecordsWalletAddress = walletAddress } catch { chainsNotMatch = [] }