Created
March 11, 2018 12:20
-
-
Save pooot/2907965b7f602464f6eb8a98fbf78932 to your computer and use it in GitHub Desktop.
Undefined property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computed: { | |
...mapState({ | |
isLoggedIn: 'auth/isLoggedIn', | |
activities: 'auth/activities' | |
}), | |
booked() { | |
return this.isLoggedIn ? this.activities.includes(this.activity.id) : false | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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