Skip to content

Commit

Permalink
Don't show untappd rating if it's 0.0
Browse files Browse the repository at this point in the history
That means there aren't enough scores for Untappd to give it a
rating.

Fixes #30.
  • Loading branch information
drewbrew committed May 22, 2019
1 parent 3e45a97 commit 8540f34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/BeerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ export default {
if (this.beers[i].untappd_metadata) {
if (this.beers[i].untappd_metadata.json_data) {
const rating = this.beers[i].untappd_metadata.json_data.rating_score;
this.beers[i].rating = Number(rating).toFixed(1);
this.beers[i].rating_count = this.beers[i].untappd_metadata.json_data.rating_count;
const rating = Number(this.beers[i].untappd_metadata.json_data.rating_score).toFixed(1);
if (rating > 0.0) {
this.beers[i].rating = rating;
this.beers[i].rating_count = this.beers[i].untappd_metadata.json_data.rating_count;
}
}
}
if (this.beers[i].abv) {
Expand Down

0 comments on commit 8540f34

Please sign in to comment.