mirror of
https://github.com/desktop/desktop
synced 2024-10-31 05:19:03 +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() {
|
||||
if (!this.props.user) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
const api = new Octokat({token: this.props.user.getToken()})
|
||||
const user = await api.user.fetch()
|
||||
this.setState({userAvatarURL: user.avatarUrl})
|
||||
console.log('user', user)
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
private renderNoSelection() {
|
||||
|
|
Loading…
Reference in a new issue