diff --git a/src/App.vue b/src/App.vue index c16628a4f..ca711271b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -66,7 +66,7 @@ export default { ] = await Promise.all([ Backend.getCacheChainNames(), Backend.getOracleCache(), - Backend.getTopicsCache(), + Backend.getTopics(), Backend.getVerifiedUrls(), Backend.getGrayListedUrls(), Backend.getTokenInfo(), diff --git a/src/components/TipInput.vue b/src/components/TipInput.vue index 24c7f7bc6..9073ebc8b 100644 --- a/src/components/TipInput.vue +++ b/src/components/TipInput.vue @@ -113,7 +113,8 @@ export default { ...mapGetters('backend', ['minTipAmount']), ...mapState('backend', { tipUrlStats({ stats }) { - const urlStats = stats && stats.by_url.find(({ url }) => url === this.tipUrl); + // const urlStats = stats && stats.by_url.find(({ url }) => url === this.tipUrl); + const urlStats = null; // TODO url stats return { isTipped: urlStats ? urlStats.senders.includes(this.address) : false, totalAmountAe: urlStats ? urlStats.total_amount_ae : '0', @@ -122,7 +123,7 @@ export default { }, }), largestFtTipAmount() { - return this.tip.Aggregation.totaltokenamount.length + return this.tip && this.tip.Aggregation.totaltokenamount.length ? this.tip.Aggregation.totaltokenamount.reduce( (a, b) => (a.amount > b.amount ? a : b), this.tip.Aggregation.totaltokenamount[0], @@ -130,7 +131,7 @@ export default { : null; }, tipAmount() { - return +this.tip.Aggregation.totalurlamount !== 0 + return this.tip && this.tip.Aggregation.totalurlamount !== 0 ? { value: this.tip.Aggregation.totalurlamount, token: null, diff --git a/src/components/layout/Overview.vue b/src/components/layout/Overview.vue index ff9e2f09d..ebe4afac0 100644 --- a/src/components/layout/Overview.vue +++ b/src/components/layout/Overview.vue @@ -4,7 +4,7 @@ class="overview" >
- {{ stats.total_tips_length }} + {{ stats.tipslength }}
{{ $t('components.layout.Overview.TipsAggregated') }} @@ -18,14 +18,14 @@
- {{ stats.senders_length }} + {{ stats.senderslength }}
{{ $t('components.layout.Overview.UniqueTipSenders') }}
@@ -33,7 +33,7 @@
diff --git a/src/components/layout/RightSectionTopics.vue b/src/components/layout/RightSectionTopics.vue index 0c9b81cc8..e200cb09d 100644 --- a/src/components/layout/RightSectionTopics.vue +++ b/src/components/layout/RightSectionTopics.vue @@ -20,7 +20,7 @@ class="text-ellipsis" :topic="topic" /> - +
diff --git a/src/store/modules/backend.js b/src/store/modules/backend.js index 04a40a60b..52501d6a1 100644 --- a/src/store/modules/backend.js +++ b/src/store/modules/backend.js @@ -65,14 +65,14 @@ export default { if (tipsReloading[args]) return; commit('tipsReloading', args); const value = (await Promise.all( - times(tipsPageCount[args], (p) => Backend.getCacheFeed(p + 1, ...args)), + times(tipsPageCount[args], (p) => Backend.getFeed(p + 1, ...args)), )).flat().filter((p) => p); commit('setTips', { args, value }); }, async loadNextPageOfTips({ commit, state }, args) { if (state.tipsEndReached[args] || state.tipsNextPageLoading[args]) return; commit('tipsNextPageLoading', args); - const value = await Backend.getCacheFeed(state.tipsPageCount[args] + 1, ...args); + const value = await Backend.getFeed(state.tipsPageCount[args] + 1, ...args); commit('addTips', { args, value }); }, async reloadUserComments({ commit }, address) { @@ -103,7 +103,7 @@ export default { }, async reloadStats({ commit, rootState: { aeternity: { sdk } } }) { const [stats1, stats2, height] = await Promise.all([ - Backend.getCacheStats(), + Backend.getTipStats(), Backend.getStats(), sdk.height(), ]); diff --git a/src/utils/backend.js b/src/utils/backend.js index 32a29241d..744c6a55c 100644 --- a/src/utils/backend.js +++ b/src/utils/backend.js @@ -74,7 +74,7 @@ export default class Backend { static getCacheUserStats = async (address) => backendFetch(`cache/userStats?address=${address}`); - static getCacheFeed = async ( + static getFeed = async ( page, ordering, address = null, @@ -99,7 +99,7 @@ export default class Backend { headers: { 'Content-Type': 'application/json' }, }); - static getCacheStats = async () => backendFetch('cache/stats'); + static getTipStats = async () => backendFetch('stats'); static getCacheChainNames = async () => backendFetch('cache/chainnames'); @@ -107,7 +107,7 @@ export default class Backend { static getOracleCache = async () => backendFetch('cache/oracle'); - static getTopicsCache = async () => backendFetch('cache/topics'); + static getTopics = async () => backendFetch('tips/topics'); static getTokenInfo = async () => backendFetch('tokenCache/tokenInfo');