Skip to content

Commit 62b0566

Browse files
committed
fix: fixed message for swap errors and improvements for custom rpc settings
1 parent 5435522 commit 62b0566

File tree

8 files changed

+43
-40
lines changed

8 files changed

+43
-40
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "liquality-wallet",
3-
"version": "0.82.2",
3+
"version": "0.82.3",
44
"private": true,
55
"author": "Liquality <info@liquality.io>",
66
"scripts": {

src/components/CustomRpcSettingsForm.vue

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ export default {
6565
computed: {
6666
...mapState(['activeNetwork', 'activeWalletId']),
6767
canSubmit() {
68-
const { networkName, newRpcUrl, chainId, currencySymbol, explorerUrl } = this.formData
68+
const { networkName, newRpcUrl, chainId, currencySymbol } = this.formData
6969
const { network } = this.settings
70+
const { custom } = network
7071
if (
71-
(networkName &&
72-
newRpcUrl &&
73-
chainId &&
74-
currencySymbol &&
75-
newRpcUrl !== this.getBaseUrl(network?.rpcUrl)) ||
76-
explorerUrl !== network?.explorerUrl
72+
networkName &&
73+
newRpcUrl &&
74+
chainId &&
75+
currencySymbol &&
76+
newRpcUrl !== this.getBaseUrl(network?.rpcUrl, custom)
7777
) {
7878
return true
7979
}
@@ -92,16 +92,20 @@ export default {
9292
walletId: this.activeWalletId,
9393
chainId,
9494
chanifyNetwork: {
95+
custom: true,
9596
...network,
9697
explorerUrl: this.formData.explorerUrl,
9798
rpcUrl: this.formData.newRpcUrl
9899
}
99100
}
100101
101102
await this.saveCustomChainSettings(payload)
102-
this.setSettings()
103103
},
104-
getBaseUrl(url) {
104+
getBaseUrl(url, custom = true) {
105+
if (custom === true) {
106+
return url
107+
}
108+
105109
const pathArray = url.split('/'),
106110
protocol = pathArray[0],
107111
host = pathArray[2]
@@ -114,20 +118,28 @@ export default {
114118
walletId: this.activeWalletId,
115119
chainId: chain
116120
})
117-
this.setSettings()
118121
},
119122
setSettings() {
120123
const { chain, network, asset, chainId } = this.settings
121-
const { rpcUrl, explorerUrl } = network
124+
const { rpcUrl, explorerUrl, custom } = network
122125
this.formData.networkName = chain
123126
this.formData.chainId = chainId
124127
this.formData.currencySymbol = asset
125-
this.formData.newRpcUrl = this.getBaseUrl(rpcUrl)
128+
this.formData.newRpcUrl = this.getBaseUrl(rpcUrl, custom)
126129
this.formData.explorerUrl = explorerUrl
127130
}
128131
},
129132
created() {
133+
console.log('this.settings', this.settings)
130134
this.setSettings()
135+
},
136+
watch: {
137+
settings: {
138+
handler() {
139+
this.setSettings()
140+
},
141+
deep: true
142+
}
131143
}
132144
}
133145
</script>

src/components/NavBar.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
<AccountsIcon />
4040
{{ $t('components.navbar.manageAccounts') }}
4141
</li>
42-
<li
43-
id="manage_accounts"
44-
v-if="experiments.customNetworkSettings"
45-
@click="customNetworkSettings"
46-
>
47-
<AccountsIcon />
48-
{{ $t('common.customNetworkSettings') }}
49-
</li>
5042
<li id="export_privkey" v-if="showExportPrivateKey" @click="exportPrivateKey">
5143
<KeyIcon />
5244
{{ $t('components.navbar.exportPrivateKey') }}

src/locales/en/components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"get": "Get"
2323
},
2424
"cannotCoverMinimumMessage": {
25-
"needMore": "More %{asset} required to cover min trade plus fees."
25+
"needMore": "More %{asset} required to cover minimum trade."
2626
},
2727
"connectionDrawer": {
2828
"dappNetwork": "dApp Network",

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 2,
3-
"version": "0.82.2",
3+
"version": "0.82.3",
44
"name": "__MSG_appName__",
55
"description": "__MSG_appDesc__",
66
"default_locale": "en",

src/views/Experiments.vue

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
@change="toggleExperiment({ name: 'manageAccounts' })"
2929
/>
3030
</div>
31+
</div>
32+
<div class="setting-item">
3133
<div class="setting-item_title flex-fill mb-2">
3234
{{ $t('pages.experiments.errorReporting') }}
3335
<span class="setting-item_sub">
@@ -42,20 +44,6 @@
4244
@change="toggleExperiment({ name: 'reportErrors' })"
4345
/>
4446
</div>
45-
<div class="setting-item_title flex-fill mb-2">
46-
{{ $t('common.customNetworkSettings') }}
47-
<span class="setting-item_sub">
48-
{{ $t('common.customNetworkSettings') }}
49-
</span>
50-
</div>
51-
<div class="setting-item_control">
52-
<toggle-button
53-
id="exp-customNetworkSettings-toggle-switch"
54-
:css-colors="true"
55-
:value="experiments['customNetworkSettings']"
56-
@change="toggleExperiment({ name: 'customNetworkSettings' })"
57-
/>
58-
</div>
5947
</div>
6048
</div>
6149
</div>

src/views/SettingItems.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
{{ $t('pages.settings.networksSub') }}
101101
</span>
102102
</div>
103+
<ChevronRightIcon class="list-item-chevron" />
103104
</router-link>
104105
</div>
105106
</div>
@@ -232,6 +233,11 @@ export default {
232233
}
233234
</script>
234235
<style scoped lang="scss">
236+
.setting-item {
237+
a {
238+
display: flex;
239+
}
240+
}
235241
.setting-item_title {
236242
&_accounts {
237243
display: inline-flex;
@@ -243,4 +249,9 @@ export default {
243249
}
244250
}
245251
}
252+
253+
.list-item-chevron {
254+
width: 6px;
255+
margin-bottom: 2px;
256+
}
246257
</style>

src/views/Swap/Swap.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959
:asset="selectedQuote.bridgeAsset"
6060
/>
6161
</InfoNotification>
62-
<InfoNotification v-else-if="cannotCoverMinimum && !insufficientFundsError">
63-
<CannotCoverMinimumMessage :asset="asset" :account-id="account.id" />
64-
</InfoNotification>
6562
<InfoNotification v-else-if="ethRequired && !insufficientFundsError">
6663
<EthRequiredMessage :account-id="account.id" :action="'swap'" />
6764
</InfoNotification>
65+
<InfoNotification v-else-if="cannotCoverMinimum && !insufficientFundsError">
66+
<CannotCoverMinimumMessage :asset="asset" :account-id="account.id" />
67+
</InfoNotification>
6868
<div class="wrapper form">
6969
<div class="wrapper_top">
7070
<SendInput

0 commit comments

Comments
 (0)