fix(keybase): Invite fetch doesn't need JSON parse

This commit is contained in:
Ben Gotow 2016-06-14 12:26:43 -07:00
parent 3b79b4a2e0
commit 3baa987c61

View file

@ -41,12 +41,11 @@ class KeybaseInviteButton extends React.Component
success: (body, response) => success: (body, response) =>
@setState({loading: false}) @setState({loading: false})
try try
{invite_url} = JSON.parse(body) if not (body instanceof Object) or not body.invite_url
if not invite_url
throw new Error("We were unable to retrieve an invitation.") throw new Error("We were unable to retrieve an invitation.")
catch err catch err
errorHandler(err) errorHandler(err)
require('electron').shell.openExternal(invite_url) require('electron').shell.openExternal(body.invite_url)
render: => render: =>
if @state.loading if @state.loading