Skip to content

Commit

Permalink
Fixing intended usage for suggested hotspots
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Pereira committed Sep 11, 2021
1 parent de11f77 commit e2a80e2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions components/sections/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}]
Expand All @@ -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) => {
Expand All @@ -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) => {
Expand All @@ -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 [{
Expand Down

0 comments on commit e2a80e2

Please sign in to comment.