Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Sean Yesmunt
94e3b4eee0 call rewardList after invite status so rewards are updated based on invites 2019-02-04 12:01:22 -05:00
Sean Yesmunt
28697c9968 fix: prevent multiple user/me calls for new users 2019-02-04 11:55:56 -05:00
3 changed files with 22 additions and 11 deletions

17
dist/bundle.js vendored
View file

@ -802,14 +802,14 @@ Lbryio.authenticate = function () {
}
// check that token works
return Lbryio.getCurrentUser().then(function () {
return true;
return Lbryio.getCurrentUser().then(function (user) {
return user;
}).catch(function () {
return false;
});
}).then(function (isTokenValid) {
if (isTokenValid) {
return reject;
}).then(function (user) {
if (user) {
return user;
}
return _lbryRedux.Lbry.status().then(function (status) {
@ -827,7 +827,12 @@ Lbryio.authenticate = function () {
return reject();
});
}).then(Lbryio.getCurrentUser).then(resolve, reject);
}).then(function (user) {
if (!user) {
return Lbryio.getCurrentUser();
}
return user;
}).then(resolve, reject);
});
}

View file

@ -115,12 +115,12 @@ Lbryio.authenticate = () => {
// check that token works
return Lbryio.getCurrentUser()
.then(() => true)
.then(user => user)
.catch(() => false);
})
.then(isTokenValid => {
if (isTokenValid) {
return reject;
.then(user => {
if (user) {
return user;
}
return Lbry.status().then(status => {
@ -137,7 +137,12 @@ Lbryio.authenticate = () => {
return reject();
});
})
.then(Lbryio.getCurrentUser)
.then(user => {
if (!user) {
return Lbryio.getCurrentUser();
}
return user;
})
.then(resolve, reject);
});
}

View file

@ -16,6 +16,7 @@ export function doFetchInviteStatus() {
Lbryio.call('user', 'invite_status')
.then(status => {
dispatch(doRewardList());
dispatch({
type: ACTIONS.USER_INVITE_STATUS_FETCH_SUCCESS,
data: {