Skip to content

Commit b9a82bc

Browse files
authored
Merge pull request #858 from aeternity/release/0.2.1
Release 0.2.1
2 parents 0a5f191 + cdaa3b4 commit b9a82bc

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VUE_APP_WALLET_URL=https://wallet.superhero.com
22
VUE_APP_JITSI_URL=meet.aepps.com
33
VUE_APP_BACKEND_URL=https://raendom-backend.z52da5wt.xyz
4-
VUE_APP_CONTRACT_V1_ADDRESS=ct_2Cvbf3NYZ5DLoaNYAU71t67DdXLHeSXhodkSNifhgd7Xsw28Xd
4+
VUE_APP_CONTRACT_V1_ADDRESS=ct_2AfnEfCSZCTEkxL5Yoi4Yfq6fF7YapHRaFKDJK3THMXMBspp5z
55
VUE_APP_CONTRACT_V2_ADDRESS=

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "superhero-ui",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"scripts": {
55
"serve": "vue-cli-service serve",
66
"build": "vue-cli-service build",

src/components/TipInput.vue

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<img :src="iconTip">
1111
<template v-if="!userAddress">
1212
<AeAmountFiat
13-
v-if="!isTokenAndZeroAeTip"
14-
:amount="tip ? tipUrlStats.amount_ae || tip.total_amount_ae : '0'"
13+
v-if="!tipUrlStats.tokenTotalAmount.length || +tipUrlStats.totalAmountAe !== 0"
14+
:amount="tipUrlStats.totalAmountAe"
1515
/>
1616
<AeAmountFiat
17-
v-for="tokenTip in tipUrlStats.token_total_amount || tip.token_total_amount"
17+
v-for="tokenTip in tipUrlStats.tokenTotalAmount"
1818
:key="tokenTip.token"
1919
:amount="tokenTip.amount"
2020
:token="tokenTip.token"
@@ -61,7 +61,6 @@
6161

6262
<script>
6363
import { mapState, mapGetters } from 'vuex';
64-
import BigNumber from 'bignumber.js';
6564
import iconTip from '../assets/iconTip.svg';
6665
import iconTipUser from '../assets/iconTipUser.svg';
6766
import iconTipped from '../assets/iconTipped.svg';
@@ -102,19 +101,13 @@ export default {
102101
...mapState('backend', {
103102
tipUrlStats({ stats }) {
104103
const urlStats = stats && stats.by_url.find(({ url }) => url === this.tipUrl);
105-
if (!urlStats) return {};
106104
return {
107-
isTipped: urlStats.senders.includes(this.address),
108-
amount_ae: urlStats.total_amount_ae,
109-
token_total_amount: urlStats.token_total_amount,
105+
isTipped: urlStats ? urlStats.senders.includes(this.address) : false,
106+
totalAmountAe: urlStats ? urlStats.total_amount_ae : '0',
107+
tokenTotalAmount: urlStats ? urlStats.token_total_amount : [],
110108
};
111109
},
112110
}),
113-
isTokenAndZeroAeTip() {
114-
return new BigNumber(this.tipUrlStats.amount_ae || '0').isZero()
115-
&& new BigNumber(this.tip.total_amount_ae).isZero()
116-
&& !!this.tip.token;
117-
},
118111
isTokenTipable() {
119112
return this.tip.id.split('_')[1] === 'v2';
120113
},
@@ -154,11 +147,8 @@ export default {
154147
const amount = shiftDecimalPlaces(this.inputValue,
155148
this.inputToken !== 'native' ? this.tokenInfo[this.inputToken].decimals : 18).toFixed();
156149
157-
if (this.tipUrl !== this.tip.url) {
158-
await tip(this.tipUrl, this.message, amount, this.inputToken);
159-
} else {
160-
await retip(this.tip.contractId, this.tip.id, amount, this.inputToken);
161-
}
150+
if (!this.tip) await tip(this.tipUrl, this.message, amount, this.inputToken);
151+
else await retip(this.tip.contractId, this.tip.id, amount, this.inputToken);
162152
163153
if (!this.userAddress) {
164154
await Backend.cacheInvalidateTips();

0 commit comments

Comments
 (0)