Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed Nov 28, 2023
1 parent 608ed19 commit 9cf1e8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class dydxProfileButtonsViewPresenter: HostedViewPresenter<dydxProfileButtonsVie
Router.shared?.navigate(to: RoutingRequest(path: "/transfer", params: ["section": TransferSection.withdrawal.rawValue]), animated: true, completion: nil)
}

viewModel.transferAction = { [weak self] in
viewModel.transferAction = {
Router.shared?.navigate(to: RoutingRequest(path: "/transfer", params: ["section": TransferSection.transferOut.rawValue]), animated: true, completion: nil)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ class dydxProfileHeaderViewPresenter: HostedViewPresenter<dydxProfileHeaderViewM
.sink { [weak self] walletState in
self?.viewModel?.dydxAddress = walletState.currentWallet?.cosmoAddress
self?.viewModel?.sourceAddress = walletState.currentWallet?.ethereumAddress
if let address = walletState.currentWallet?.cosmoAddress {
if let cosmoAddress = walletState.currentWallet?.cosmoAddress {
self?.viewModel?.copyAction = {
UIPasteboard.general.string = address
UIPasteboard.general.string = cosmoAddress
}
}
if let ethereumAddress = walletState.currentWallet?.ethereumAddress {
self?.viewModel?.openInEtherscanAction = {
let urlString = "https://etherscan.io/address/\(address)"
let urlString = "https://etherscan.io/address/\(ethereumAddress)"
if let url = URL(string: urlString), URLHandler.shared?.canOpenURL(url) ?? false {
URLHandler.shared?.open(url, completionHandler: nil)
}
Expand Down

0 comments on commit 9cf1e8c

Please sign in to comment.