diff --git a/src/components/TipInput.vue b/src/components/TipInput.vue
index d0133b9dc..3946b02a5 100644
--- a/src/components/TipInput.vue
+++ b/src/components/TipInput.vue
@@ -50,7 +50,7 @@
@@ -116,12 +116,12 @@ export default {
const urlStats = stats && this.tipUrl
&& stats.urlStats.find(({ url }) => url === this.tipUrl);
- const tipTokenAmount = this.tip.token
+ const tipTokenAmount = this.tip?.token
? [{ token: this.tip.token, amount: this.tip.tokenAmount }] : [];
return {
isTipped: urlStats ? urlStats.senders.includes(this.address) : false,
- totalAmount: urlStats ? urlStats.totalAmount : this.tip.amount || '0',
+ totalAmount: urlStats ? urlStats.totalAmount : this.tip?.amount || '0',
tokenTotalAmount: urlStats ? urlStats.totalTokenAmount : tipTokenAmount,
};
},
@@ -140,7 +140,7 @@ export default {
: null;
},
tipAmount() {
- return +this.tipUrlStats.totalAmount !== 0
+ return +this.tipUrlStats.totalAmount !== '0'
? {
value: this.tipUrlStats.totalAmount,
token: null,
@@ -157,6 +157,9 @@ export default {
&& this.inputToken !== null
);
},
+ isRetippable() {
+ return this.tip && this.tip.type !== 'POST_WITHOUT_TIP';
+ },
tipUrl() {
if (this.comment) {
return `https://superhero.com/tip/${this.comment.tipId}/comment/${this.comment.id}`;
@@ -203,7 +206,7 @@ export default {
: 18,
).toFixed();
- if (!this.tip) {
+ if (!this.isRetippable) {
await this.$store.dispatch('aeternity/tip', {
url: this.tipUrl,
title: this.message,
diff --git a/src/utils/backend.js b/src/utils/backend.js
index 512c5a769..0a9d16154 100644
--- a/src/utils/backend.js
+++ b/src/utils/backend.js
@@ -115,7 +115,7 @@ export default class Backend {
if (ordering) queryParams.set('ordering', ordering);
if (direction) queryParams.set('direction', direction);
if (search) queryParams.set('search', search);
- return backendFetch(`tokenCache/wordRegistry?${queryParams.toString()}`);
+ return process.env.VUE_APP_CONTRACT_V2_ADDRESS ? backendFetch(`tokenCache/wordRegistry?${queryParams.toString()}`) : Promise.resolve({});
}
static getWordSaleVotesDetails = async (address) => backendFetch(`tokenCache/wordSaleVotesDetails/${address}`);