mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
fix(keybase): Invite fetch doesn't need JSON parse
This commit is contained in:
parent
3b79b4a2e0
commit
3baa987c61
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue