fix multiple install ids

This commit is contained in:
Jeremy Kauffman 2017-05-31 18:19:48 -04:00
parent 149d1ef61f
commit 9f1e5489a1
2 changed files with 5 additions and 5 deletions

View file

@ -41,7 +41,7 @@ class SubmitEmailStage extends React.Component {
lbryio.call('user_email', 'new', {email: this.state.email}, 'post').then(() => {
this.onEmailSaved(this.state.email);
}, (error) => {
if (error.xhr && error.xhr.status == 409) {
if (error.xhr && (error.xhr.status == 409 || error.message == "This email is already in use")) {
this.onEmailSaved(this.state.email);
return;
} else if (this._emailRow) {

View file

@ -1,10 +1,10 @@
import {getLocal, getSession, setSession, setLocal} from './utils.js';
import {getSession, setSession} from './utils.js';
import lbry from './lbry.js';
const querystring = require('querystring');
const lbryio = {
_accessToken: getLocal('accessToken'),
_accessToken: getSession('accessToken'),
_authenticationPromise: null,
_user : null,
enabled: true
@ -95,11 +95,11 @@ lbryio.call = function(resource, action, params={}, method='get', evenIfDisabled
};
lbryio.getAccessToken = () => {
return getLocal('accessToken');
return getSession('accessToken');
}
lbryio.setAccessToken = (token) => {
setLocal('accessToken', token)
setSession('accessToken', token)
}
lbryio.authenticate = function() {