From e2a80e2d7735cd4d3b537ca1970576afcf470d93 Mon Sep 17 00:00:00 2001 From: Michael Pereira Date: Sat, 11 Sep 2021 19:22:30 -0400 Subject: [PATCH] Fixing intended usage for suggested hotspots --- components/sections/Home.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/sections/Home.vue b/components/sections/Home.vue index 2e3bafa..7df4569 100644 --- a/components/sections/Home.vue +++ b/components/sections/Home.vue @@ -59,7 +59,7 @@ export default class Home extends Vue { } get filteredDataArray(): ({ type: string; items: string[]; }[] | { type: string; items: any; })[] { - if (this.userInput === '' && !Object.keys(this.$store.getters.favourites.hasOwnProperty).length && this.$store.getters.recentlyViewed.length === 0) { + if (this.userInput === '' && this.$store.getters.recentlyViewed.length === 0) { return [{ type: 'Suggested Hotspots', items: hotspots.miners }] @@ -68,12 +68,6 @@ export default class Home extends Vue { if (this.userInput === '') { const results = [] - if (!Object.keys(this.$store.getters.favourites.hasOwnProperty).length) { - results.push([{ - type: 'Suggested Hotspots', items: hotspots.miners - }]) - } - if (Object.keys(this.$store.getters.favourites).length > 0) { results.push({ type: 'Favourites', items: Object.values(this.$store.getters.favourites).filter((option: any) => { @@ -83,7 +77,7 @@ export default class Home extends Vue { }) }) } - + if (this.$store.getters.recentlyViewed.length > 0) { results.push({ type: 'Search Results', items: this.$store.getters.recentlyViewed.filter((option: any) => { @@ -93,6 +87,13 @@ export default class Home extends Vue { }) }) } + + if (Object.keys(this.$store.getters.favourites).length === 0) { + results.push({ + type: 'Suggested Hotspots', items: hotspots.miners + }) + } + return results } else { return [{