Merge pull request #3057 from vladyslav-iosdev/#3056

Tapping send button doesn't work in TokenViewController presented from activities list #3056
pull/3050/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit 4e22dd532d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      AlphaWallet/InCoordinator.swift
  2. 6
      AlphaWallet/Tokens/Coordinators/SingleChainTokenCoordinator.swift
  3. 10
      AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift
  4. 1
      AlphaWallet/Tokens/ViewControllers/TokenViewController.swift

@ -1038,8 +1038,15 @@ extension InCoordinator: TokensCoordinatorDelegate {
dappBrowserCoordinator.switch(toServer: server, url: url) dappBrowserCoordinator.switch(toServer: server, url: url)
} }
func didPress(for type: PaymentFlow, server: RPCServer, in coordinator: TokensCoordinator) { func didPress(for type: PaymentFlow, server: RPCServer, inViewController viewController: UIViewController?, in coordinator: TokensCoordinator) {
showPaymentFlow(for: type, server: server, navigationController: coordinator.navigationController) let navigationController: UINavigationController
if let nvc = viewController?.navigationController {
navigationController = nvc
} else {
navigationController = coordinator.navigationController
}
showPaymentFlow(for: type, server: server, navigationController: navigationController)
} }
func didTap(transaction: TransactionInstance, inViewController viewController: UIViewController, in coordinator: TokensCoordinator) { func didTap(transaction: TransactionInstance, inViewController viewController: UIViewController, in coordinator: TokensCoordinator) {

@ -29,7 +29,7 @@ protocol SingleChainTokenCoordinatorDelegate: class, CanOpenURL {
func tokensDidChange(inCoordinator coordinator: SingleChainTokenCoordinator) func tokensDidChange(inCoordinator coordinator: SingleChainTokenCoordinator)
func didTapSwap(forTransactionType transactionType: TransactionType, service: SwapTokenURLProviderType, in coordinator: SingleChainTokenCoordinator) func didTapSwap(forTransactionType transactionType: TransactionType, service: SwapTokenURLProviderType, in coordinator: SingleChainTokenCoordinator)
func shouldOpen(url: URL, shouldSwitchServer: Bool, forTransactionType transactionType: TransactionType, in coordinator: SingleChainTokenCoordinator) func shouldOpen(url: URL, shouldSwitchServer: Bool, forTransactionType transactionType: TransactionType, in coordinator: SingleChainTokenCoordinator)
func didPress(for type: PaymentFlow, inCoordinator coordinator: SingleChainTokenCoordinator) func didPress(for type: PaymentFlow, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator)
func didTap(transaction: TransactionInstance, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator) func didTap(transaction: TransactionInstance, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator)
func didTap(activity: Activity, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator) func didTap(activity: Activity, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator)
func didPostTokenScriptTransaction(_ transaction: SentTransaction, in coordinator: SingleChainTokenCoordinator) func didPostTokenScriptTransaction(_ transaction: SentTransaction, in coordinator: SingleChainTokenCoordinator)
@ -606,11 +606,11 @@ extension SingleChainTokenCoordinator: TokenViewControllerDelegate {
} }
func didTapSend(forTransactionType transactionType: TransactionType, inViewController viewController: TokenViewController) { func didTapSend(forTransactionType transactionType: TransactionType, inViewController viewController: TokenViewController) {
delegate?.didPress(for: .send(type: transactionType), inCoordinator: self) delegate?.didPress(for: .send(type: transactionType), inViewController: viewController, in: self)
} }
func didTapReceive(forTransactionType transactionType: TransactionType, inViewController viewController: TokenViewController) { func didTapReceive(forTransactionType transactionType: TransactionType, inViewController viewController: TokenViewController) {
delegate?.didPress(for: .request, inCoordinator: self) delegate?.didPress(for: .request, inViewController: viewController, in: self)
} }
func didTap(activity: Activity, inViewController viewController: TokenViewController) { func didTap(activity: Activity, inViewController viewController: TokenViewController) {

@ -7,7 +7,7 @@ import PromiseKit
protocol TokensCoordinatorDelegate: class, CanOpenURL { protocol TokensCoordinatorDelegate: class, CanOpenURL {
func didTapSwap(forTransactionType transactionType: TransactionType, service: SwapTokenURLProviderType, in coordinator: TokensCoordinator) func didTapSwap(forTransactionType transactionType: TransactionType, service: SwapTokenURLProviderType, in coordinator: TokensCoordinator)
func shouldOpen(url: URL, shouldSwitchServer: Bool, forTransactionType transactionType: TransactionType, in coordinator: TokensCoordinator) func shouldOpen(url: URL, shouldSwitchServer: Bool, forTransactionType transactionType: TransactionType, in coordinator: TokensCoordinator)
func didPress(for type: PaymentFlow, server: RPCServer, in coordinator: TokensCoordinator) func didPress(for type: PaymentFlow, server: RPCServer, inViewController viewController: UIViewController?, in coordinator: TokensCoordinator)
func didTap(transaction: TransactionInstance, inViewController viewController: UIViewController, in coordinator: TokensCoordinator) func didTap(transaction: TransactionInstance, inViewController viewController: UIViewController, in coordinator: TokensCoordinator)
func didTap(activity: Activity, inViewController viewController: UIViewController, in coordinator: TokensCoordinator) func didTap(activity: Activity, inViewController viewController: UIViewController, in coordinator: TokensCoordinator)
func openConsole(inCoordinator coordinator: TokensCoordinator) func openConsole(inCoordinator coordinator: TokensCoordinator)
@ -251,7 +251,7 @@ extension TokensCoordinator: SelectAssetCoordinatorDelegate {
case .pending(let address): case .pending(let address):
let paymentFlow = PaymentFlow.send(type: .init(token: token, recipient: .address(address), amount: nil)) let paymentFlow = PaymentFlow.send(type: .init(token: token, recipient: .address(address), amount: nil))
delegate?.didPress(for: paymentFlow, server: token.server, in: self) delegate?.didPress(for: paymentFlow, server: token.server, inViewController: .none, in: self)
case .none: case .none:
break break
} }
@ -285,7 +285,7 @@ extension TokensCoordinator: QRCodeResolutionCoordinatorDelegate {
let paymentFlow = PaymentFlow.send(type: transactionType) let paymentFlow = PaymentFlow.send(type: transactionType)
delegate?.didPress(for: paymentFlow, server: token.server, in: self) delegate?.didPress(for: paymentFlow, server: token.server, inViewController: .none, in: self)
} }
func coordinator(_ coordinator: QRCodeResolutionCoordinator, didResolveAddress address: AlphaWallet.Address, action: ScanQRCodeAction) { func coordinator(_ coordinator: QRCodeResolutionCoordinator, didResolveAddress address: AlphaWallet.Address, action: ScanQRCodeAction) {
@ -408,8 +408,8 @@ extension TokensCoordinator: SingleChainTokenCoordinatorDelegate {
tokensViewController.fetch() tokensViewController.fetch()
} }
func didPress(for type: PaymentFlow, inCoordinator coordinator: SingleChainTokenCoordinator) { func didPress(for type: PaymentFlow, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator) {
delegate?.didPress(for: type, server: coordinator.session.server, in: self) delegate?.didPress(for: type, server: coordinator.session.server, inViewController: viewController, in: self)
} }
func didTap(activity: Activity, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator) { func didTap(activity: Activity, inViewController viewController: UIViewController, in coordinator: SingleChainTokenCoordinator) {

@ -83,7 +83,6 @@ class TokenViewController: UIViewController {
activitiesService.subscribableViewModel.subscribe { [weak self] viewModel in activitiesService.subscribableViewModel.subscribe { [weak self] viewModel in
guard let strongSelf = self, let viewModel = viewModel else { return } guard let strongSelf = self, let viewModel = viewModel else { return }
NSLog("KKKK-ST: subscribableViewModel (on next): \(viewModel.itemsCount)")
strongSelf.activityPageView.configure(viewModel: .init(activitiesViewModel: viewModel)) strongSelf.activityPageView.configure(viewModel: .init(activitiesViewModel: viewModel))
} }
} }

Loading…
Cancel
Save