Skip to content

Commit

Permalink
chore(ui): avoid prefetch content
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommytrg committed Jul 17, 2021
1 parent b3c32f8 commit a3f1614
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/web3Middleware/dataFeeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const dataFeeds: Array<FeedInfo> = [
address: '0x0C4be6AA667df48de54BA174bE7948875fdf152B',
abi: WitnetRequestBoardProxy as Array<AbiItem>
}
},
}
// // Kovan (id. 42) - v0.2.0:
// // * BtcUsdPriceFeed: [0x9b3C5A6cB55E027d9ae6f265f6FB6fFA86e7b35E](https://kovan.etherscan.io/address/0x9b3C5A6cB55E027d9ae6f265f6FB6fFA86e7b35E#contracts)
// // * EthUsdPriceFeed: [0xA996939e6a07a0D1D6376c59BE515d8441f5E9b8](https://kovan.etherscan.io/address/0xA996939e6a07a0D1D6376c59BE515d8441f5E9b8#contracts)
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/DataFeedDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { getWitnetBlockExplorerLink } from '@/utils/getWitnetBlockExplorerLink'
export default {
apollo: {
feed: {
prefetch: true,
prefetch: false,
query: feed,
variables() {
return {
Expand All @@ -58,7 +58,7 @@ export default {
pollInterval: 60000,
},
requests: {
prefetch: true,
prefetch: false,
query: requests,
variables() {
return {
Expand Down
38 changes: 20 additions & 18 deletions packages/ui/components/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import feeds from '@/apollo/queries/feeds.gql'
export default {
apollo: {
feeds: {
prefetch: true,
prefetch: false,
query: feeds,
variables() {
return {
Expand All @@ -54,25 +54,27 @@ export default {
},
computed: {
numberOfPages() {
return Math.ceil(this.feeds.total / this.itemsPerPage)
return this.feeds ? Math.ceil(this.feeds.total / this.itemsPerPage) : 1
},
allFeeds() {
return this.feeds.feeds.map((feed) => {
return {
detailsPath: {
name: 'feeds-id',
params: { id: feed.id },
},
name: feed.name,
value: feed.lastResult,
label: feed.label,
img: {
name: this.formatSvgName(feed.name),
alt: feed.name,
},
network: feed.network,
}
})
return this.feeds
? this.feeds.feeds.map((feed) => {
return {
detailsPath: {
name: 'feeds-id',
params: { id: feed.id },
},
name: feed.name,
value: feed.lastResult,
label: feed.label,
img: {
name: this.formatSvgName(feed.name),
alt: feed.name,
},
network: feed.network,
}
})
: []
},
},
methods: {
Expand Down

0 comments on commit a3f1614

Please sign in to comment.