mirror of
https://github.com/desktop/desktop
synced 2024-10-31 11:07:25 +00:00
Get outta there early if we don't have a user.
This commit is contained in:
parent
54babe12ab
commit
c9e4b1b629
1 changed files with 5 additions and 0 deletions
|
@ -50,10 +50,15 @@ export default class Info extends React.Component<InfoProps, InfoState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async componentWillMount() {
|
public async componentWillMount() {
|
||||||
|
if (!this.props.user) {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
|
||||||
const api = new Octokat({token: this.props.user.getToken()})
|
const api = new Octokat({token: this.props.user.getToken()})
|
||||||
const user = await api.user.fetch()
|
const user = await api.user.fetch()
|
||||||
this.setState({userAvatarURL: user.avatarUrl})
|
this.setState({userAvatarURL: user.avatarUrl})
|
||||||
console.log('user', user)
|
console.log('user', user)
|
||||||
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderNoSelection() {
|
private renderNoSelection() {
|
||||||
|
|
Loading…
Reference in a new issue