Skip to content

Commit

Permalink
feat(#494): Fix chart item load on gallery component
Browse files Browse the repository at this point in the history
  • Loading branch information
tholulomo committed Jun 24, 2024
1 parent afd3af4 commit 4801597
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 13 additions & 5 deletions app/src/components/ChartGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
({{ (queryTimeMillis / 1000).toFixed(2) }} seconds)
</span>
</div>
<template v-if="!!items && !!items.length">
<template v-if="!!galleryChartItems && !!galleryChartItems.length">
<div class="gallery-grid grid grid_col-5">
<md-card
v-for="(result, index) in items"
v-for="(result, index) in galleryChartItems"
:key="index"
class="btn--animated gallery-item"
>
Expand Down Expand Up @@ -149,7 +149,7 @@ export default {
},
data() {
return {
loading: true,
loading: false,
loadError: false,
otherArgs: null,
pageNumber: 1,
Expand Down Expand Up @@ -179,7 +179,14 @@ export default {
newChartExist: 'explorer/curation/getNewChartExist',
favoriteChartItems: 'explorer/gallery/favoriteChartItems',
missingCharts: 'explorer/gallery/missingCharts'
})
}),
galleryChartItems() {
if (!this.isFavourite) {
return this.items;
} else {
return this.favoriteChartItems;
}
}
},
methods: {
...mapActions('explorer/gallery', [
Expand Down Expand Up @@ -268,6 +275,7 @@ export default {
else this.renderDialog('Missing Charts', 'missingChart', '', 80);
},
async loadFavorites() {
this.loading = true;
if (!this.favoriteChartItems.length) {
await this.fetchFavoriteCharts(false);
}
Expand All @@ -285,7 +293,7 @@ export default {
},
async mounted() {
if (this.isFavourite) {
return await this.loadFavorites();
await this.loadFavorites();
} else {
return await this.loadRegularCharts();
}
Expand Down
1 change: 0 additions & 1 deletion app/src/store/modules/auth/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default {
const surName = res.surName ?? null;
const givenName = res.givenName ?? null;
const isAdmin = res.isAdmin ?? false;
// const isAdmin = false;
const expiresIn = 9000 * 60 * 60;
const expirationDate = new Date().getTime() + expiresIn;

Expand Down

0 comments on commit 4801597

Please sign in to comment.