Skip to content

Instantly share code, notes, and snippets.

@pooot
Created March 11, 2018 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooot/2907965b7f602464f6eb8a98fbf78932 to your computer and use it in GitHub Desktop.
Save pooot/2907965b7f602464f6eb8a98fbf78932 to your computer and use it in GitHub Desktop.
Undefined property
computed: {
...mapState({
isLoggedIn: 'auth/isLoggedIn',
activities: 'auth/activities'
}),
booked() {
return this.isLoggedIn ? this.activities.includes(this.activity.id) : false
},
}
const activities = (state) => {
if (state.isLoggedIn && state.currentUser !== null) {
state.activities = state.currentUser.activities.data.map((activity) => {
return activity.id
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment