Skip to content

Commit

Permalink
Merge pull request #24 from liquality/fix-swap-screen
Browse files Browse the repository at this point in the history
fix: fixed swap screen to amount calculation and removed swtich icon
  • Loading branch information
bradleySuira authored Jan 4, 2021
2 parents 85ec59a + 07ca694 commit 4df357f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liquality-wallet",
"version": "0.10.4",
"version": "0.10.5",
"private": true,
"license": "MIT",
"author": "Liquality <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "0.10.4",
"version": "0.10.5",
"name": "Liquality Wallet",
"description": "Secure multi-crypto wallet with built-in Atomic Swaps!",
"homepage_url": "https://liquality.io",
Expand Down
29 changes: 12 additions & 17 deletions src/views/Swap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@
</div>
</div>
</div>
<div class="form-group switch-icon">
<ArrowDownIcon/>
</div>
<div class="form-group">
<div class="form-group mt-30">
<span class="float-left">
<label for="amount">Receive</label>
</span>
Expand Down Expand Up @@ -333,7 +330,6 @@ import {
import { shortenAddress } from '@/utils/address'
import { TX_TYPES, FEE_TYPES, getTxFee, getFeeLabel } from '@/utils/fees'
import SwapIcon from '@/assets/icons/arrow_swap.svg'
import ArrowDownIcon from '@/assets/icons/arrow_down.svg'
import SpinnerIcon from '@/assets/icons/spinner.svg'
import ClockIcon from '@/assets/icons/clock.svg'
import CopyIcon from '@/assets/icons/copy.svg'
Expand All @@ -353,13 +349,11 @@ export default {
DetailsContainer,
CopyIcon,
CloseIcon,
AssetList,
ArrowDownIcon
AssetList
},
data () {
return {
amount: 0,
toAmount: 0,
amountOption: 'min',
asset: null,
toAsset: null,
Expand All @@ -378,10 +372,6 @@ export default {
this.asset = this.routeAsset
this.toAsset = Object.keys(this.selectedMarket)[0]
this.amount = this.min
this.toAmount = dpUI(
BN(this.safeAmount).times(this.bestRateBasedOnAmount),
this.toAsset
)
this.updateMarketData({ network: this.activeNetwork })
this.updateFees({ asset: this.assetChain })
this.updateFees({ asset: this.toAssetChain })
Expand Down Expand Up @@ -445,6 +435,11 @@ export default {
safeAmount () {
return this.amount || 0
},
toAmount () {
return dpUI(
BN(this.safeAmount).times(this.bestRateBasedOnAmount),
this.toAsset)
},
market () {
return this.selectedMarket[this.toAsset]
},
Expand Down Expand Up @@ -603,22 +598,22 @@ export default {
this.resetAmounts()
},
setAsset (val) {
this.amount = this.min
this.asset = val
this.toAsset = Object.keys(this.selectedMarket)[0]
this.amount = this.min
this.resetAmounts()
},
resetAmounts () {
this.toAmount = dpUI(
BN(this.safeAmount).times(this.bestRateBasedOnAmount),
this.toAsset
)
this.updateFees({ asset: this.assetChain })
this.updateFees({ asset: this.toAssetChain })
this.selectedFee = {
[this.assetChain]: 'average',
[this.toAssetChain]: 'average'
}
this.toAmount = dpUI(
BN(this.safeAmount).times(this.bestRateBasedOnAmount),
this.toAsset
)
},
async swap () {
const fromAmount = cryptoassets[this.asset].currencyToUnit(this.amount)
Expand Down

0 comments on commit 4df357f

Please sign in to comment.