From 3ce98ce0263be575b51b2f78b0ebe6a56deccda8 Mon Sep 17 00:00:00 2001 From: ant013 Date: Wed, 23 Aug 2023 15:18:29 +0600 Subject: [PATCH] Fix wallet connection. Revert swap functional. --- .../Core/Adapters/Evm/EvmTransactionsAdapter.swift | 2 +- .../Core/Adapters/Tron/TronTransactionAdapter.swift | 2 +- .../Modules/Transactions/TransactionTypeFilter.swift | 4 ++-- .../WalletConnect/List/V2/WalletConnectV2ListView.swift | 1 + .../Main/V2/WalletConnectV2MainService.swift | 2 +- .../V2/WalletConnectV2PairingViewController.swift | 1 + .../UserInterface/Cells/LogoHeaderCell.swift | 8 ++++---- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Evm/EvmTransactionsAdapter.swift b/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Evm/EvmTransactionsAdapter.swift index 6c366be6f8..4c82f2402f 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Evm/EvmTransactionsAdapter.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Evm/EvmTransactionsAdapter.swift @@ -42,7 +42,7 @@ class EvmTransactionsAdapter: BaseEvmAdapter { case .all: () case .incoming: type = .incoming case .outgoing: type = .outgoing -// case .swap: type = .swap + case .swap: type = .swap case .approve: type = .approve } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Tron/TronTransactionAdapter.swift b/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Tron/TronTransactionAdapter.swift index ff7ec2fc83..5979fa29b2 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Tron/TronTransactionAdapter.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Adapters/Tron/TronTransactionAdapter.swift @@ -38,7 +38,7 @@ class TronTransactionsAdapter: BaseTronAdapter { case .all: () case .incoming: type = .incoming case .outgoing: type = .outgoing -// case .swap: type = .swap + case .swap: type = .swap case .approve: type = .approve } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Transactions/TransactionTypeFilter.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Transactions/TransactionTypeFilter.swift index 95eaad76f6..80f879826c 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Transactions/TransactionTypeFilter.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Transactions/TransactionTypeFilter.swift @@ -1,4 +1,4 @@ enum TransactionTypeFilter: String, CaseIterable { -// case all, incoming, outgoing, swap, approve - case all, incoming, outgoing, approve + case all, incoming, outgoing, swap, approve +// case all, incoming, outgoing, approve } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift index fbb3d6305c..1ef73ab1d0 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift @@ -70,6 +70,7 @@ class WalletConnectV2ListView { .image32 { component in component.imageView.cornerRadius = .cornerRadius8 component.imageView.layer.cornerCurve = .continuous + component.imageView.contentMode = .scaleAspectFit component.setImage(urlString: viewItem.imageUrl, placeholder: UIImage(named: "placeholder_rectangle_32")) }, .vStackCentered([ diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift index 637663b926..165de4a9cc 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift @@ -330,7 +330,7 @@ extension WalletConnectV2MainService: IWalletConnectMainService { } let accounts = chains.compactMap { chain in - if let firstBlockchainItem = blockchains.items.first, + if let firstBlockchainItem = blockchains.items.first(where: { item in item.chainId == chain.id }), let wcBlockchain = WalletConnectUtils.Blockchain(namespace: firstBlockchainItem.namespace, reference: chain.id.description), let wcAccount = WalletConnectUtils.Account(blockchain: wcBlockchain, address: firstBlockchainItem.address) { return wcAccount diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift index 148073138b..6f493f4867 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift @@ -79,6 +79,7 @@ class WalletConnectV2PairingViewController: ThemeViewController { .image32 { component in component.imageView.layer.cornerCurve = .continuous component.imageView.cornerRadius = .cornerRadius8 + component.imageView.contentMode = .scaleAspectFit component.setImage(urlString: viewItem.imageUrl, placeholder: UIImage(named: "placeholder_rectangle_32")) }, .vStackCentered([ diff --git a/UnstoppableWallet/UnstoppableWallet/UserInterface/Cells/LogoHeaderCell.swift b/UnstoppableWallet/UnstoppableWallet/UserInterface/Cells/LogoHeaderCell.swift index 7ed4098c01..c6afc2605e 100644 --- a/UnstoppableWallet/UnstoppableWallet/UserInterface/Cells/LogoHeaderCell.swift +++ b/UnstoppableWallet/UnstoppableWallet/UserInterface/Cells/LogoHeaderCell.swift @@ -25,11 +25,11 @@ class LogoHeaderCell: UITableViewCell { maker.size.equalTo(Self.logoSize) } - logoImageView.contentMode = .scaleAspectFill + logoImageView.contentMode = .scaleAspectFit logoImageView.cornerRadius = .cornerRadius16 logoImageView.layer.cornerCurve = .continuous logoImageView.clipsToBounds = true - logoImageView.backgroundColor = .themeSteel20 + logoImageView.backgroundColor = .clear contentView.addSubview(stackView) stackView.snp.makeConstraints { maker in @@ -76,8 +76,8 @@ class LogoHeaderCell: UITableViewCell { } } - func set(imageUrl: String?, placeholderImage: UIImage? = nil) { - logoImageView.kf.setImage(with: imageUrl.flatMap { URL(string: $0) }, placeholder: placeholderImage) + func set(imageUrl: String?) { + logoImageView.kf.setImage(with: imageUrl.flatMap { URL(string: $0) }, placeholder: UIImage(named: "placeholder_rectangle_32")) } }