Skip to content

Commit

Permalink
Revert "Disable swap function"
Browse files Browse the repository at this point in the history
This reverts commit 32f5b71.
  • Loading branch information
esen committed Sep 14, 2023
1 parent 32f5b71 commit 804203e
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 804203e

Please sign in to comment.