Skip to content

Commit

Permalink
Merge pull request #2998 from betagouv/poster-bug
Browse files Browse the repository at this point in the history
Bug fix : reparer generateur affiche pour les utilisateurs sans compte
  • Loading branch information
alemangui authored Sep 19, 2023
2 parents 4e1cade + 4ed2cd8 commit a578493
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/views/GeneratePosterPage/CanteenPoster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export default {
return !!this.diagnostic.valueTotalHt || !!this.diagnostic.percentageValueTotalHt
},
earnedBadges() {
if (!Object.keys(this.canteen).length) return {}
if (!Object.keys(this.canteen).length || !this.canteen.id) return {}
const canteenBadges = badges(this.canteen, this.diagnostic, this.$store.state.sectors)
let earnedBadges = {}
Object.keys(canteenBadges).forEach((key) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/GeneratePosterPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ export default {
return validators
},
userCanteens() {
if (!this.isAuthenticated) return []
const canteens = this.$store.state.userCanteenPreviews
return canteens.sort((a, b) => {
return normaliseText(a.name) > normaliseText(b.name) ? 1 : 0
Expand Down

0 comments on commit a578493

Please sign in to comment.