Skip to content

Commit

Permalink
Revert "Disable swap function"
Browse files Browse the repository at this point in the history
This reverts commit 6eaae15.
  • Loading branch information
ant013 committed Sep 26, 2023
1 parent 4db642e commit 98145c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ class WalletTokenBalanceViewItemFactory {
var buttons = [WalletModule.Button: ButtonState]()

switch item.element {
case .wallet:
case .wallet(let wallet):
if item.watchAccount {
buttons[.address] = .enabled
} else {
let sendButtonState: ButtonState = item.state == .synced ? .enabled : .disabled

buttons[.send] = sendButtonState
buttons[.receive] = .enabled

if wallet.token.swappable {
buttons[.swap] = sendButtonState
}
}
case .cexAsset(let cexAsset):
buttons[.withdraw] = cexAsset.withdrawEnabled ? .enabled : .disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ class WalletViewItemFactory {
case .evmPrivateKey, .hdExtendedKey, .mnemonic:
return [
.send: .enabled,
.receive: .enabled
.receive: .enabled,
.swap: .enabled
]
case .evmAddress, .tronAddress: return [:]
}
Expand Down

0 comments on commit 98145c3

Please sign in to comment.