Skip to content

Commit

Permalink
fix: change fetch policy to network only
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Oct 26, 2021
1 parent 72f952c commit f99d8e7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/repository/Feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class FeedRepository {
}

public getTotalCount (): Promise<number> {
return this.collection.count()
return this.collection.countDocuments()
}

private normalizeId (feed: FeedDbObject): FeedDbObjectNormalized | null {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/DataFeeds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
auto-fill,
250px
);
justify-items: center;
justify-content: center;
align-items: center;
}
Expand Down
49 changes: 24 additions & 25 deletions packages/ui/components/Main.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div v-if="!$apollo.loading">
<div>
<div class="section-header">
<p class="section-title">{{ $t('main.data_feeds') }}</p>
<!-- <Select
<Select
:options="options"
:default-option="selected"
@update-selected="updateSelected"
/> -->
/>
</div>
<div class="list-container">
<div v-if="feeds && feeds.total > 0" class="list-container">
<DataFeeds :feeds="allFeeds" />
<!-- <el-pagination
v-if="numberOfPages > 1"
Expand All @@ -31,6 +31,7 @@ export default {
feeds: {
prefetch: true,
query: feeds,
fetchPolicy: 'network-only',
variables() {
return {
page: this.currentPage,
Expand Down Expand Up @@ -60,27 +61,25 @@ export default {
return Math.ceil(this.feeds.total / this.itemsPerPage)
},
allFeeds() {
return this.feeds.feeds
.map((feed) => {
return {
detailsPath: {
name: 'feeds-id',
params: { id: feed.feedFullName },
},
decimals: parseInt(feed.feedFullName.split('_').pop()) || 3,
name: feed.name,
value: feed.lastResult,
label: feed.label,
img: {
name: formatSvgName(feed.name),
alt: feed.name,
},
network: feed.network,
color: feed.color,
blockExplorer: feed.blockExplorer,
}
})
.sort((a, b) => a.network < b.network)
return this.feeds.feeds.map((feed) => {
return {
detailsPath: {
name: 'feeds-id',
params: { id: feed.feedFullName },
},
decimals: parseInt(feed.feedFullName.split('_').pop()) || 3,
name: feed.name,
value: feed.lastResult,
label: feed.label,
img: {
name: formatSvgName(feed.name),
alt: feed.name,
},
network: feed.network,
color: feed.color,
blockExplorer: feed.blockExplorer,
}
})
},
},
methods: {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/ThemeSwitch.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="icon-container">
<font-awesome-icon class="mode-icon" :icon="icon" @click="toggleMode" />
<div class="icon-container" @click="toggleMode">
<font-awesome-icon class="mode-icon" :icon="icon" />
</div>
</template>

Expand Down

0 comments on commit f99d8e7

Please sign in to comment.