Skip to content

Instantly share code, notes, and snippets.

@darjanin
Last active June 5, 2016 21:53
Show Gist options
  • Save darjanin/b7b03a309ed3a7aebb740d1b7834335f to your computer and use it in GitHub Desktop.
Save darjanin/b7b03a309ed3a7aebb740d1b7834335f to your computer and use it in GitHub Desktop.
showUser(userId){
if (this.state.loggedIn) {
this.setState({
userToShow: userId || databaseUtils.getUserInfo().uid
})
this.changePage('user')
}
}
// maybe
showUser(userId){
if (this.state.loggedIn) {
this.setState({
userToShow: userId || databaseUtils.getUserInfo().uid,
page: 'user',
})
}
}
// old
showUser(userId){
if (!userId && !this.state.loggedIn) return
if (!userId) userId = databaseUtils.getUserInfo().uid
console.log(userId)
this.setState({
userToShow: userId
})
this.changePage('user')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment