Merge pull request from lbryio/email-verification

Add `fetchSilently` param for `doUserFetch`
This commit is contained in:
Sean Yesmunt 2019-01-07 15:46:35 -05:00 committed by GitHub
commit cee70d482c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 16 deletions
dist
src/redux/actions

11
dist/bundle.js vendored
View file

@ -8680,8 +8680,17 @@ function doAuthenticate(appVersion) {
};
}
function doUserFetch() {
function doUserFetch(fetchSilently) {
return function (dispatch) {
// If we are doing this in the background, do not set loading = true
if (fetchSilently) {
return _lbryio2.default.getCurrentUser().then(function (user) {
dispatch({
type: _lbryRedux.ACTIONS.USER_FETCH_SUCCESS,
data: { user: user }
});
});
}
dispatch({
type: _lbryRedux.ACTIONS.USER_FETCH_STARTED
});

View file

@ -74,8 +74,17 @@ export function doAuthenticate(appVersion, os = null) {
};
}
export function doUserFetch() {
export function doUserFetch(fetchSilently) {
return dispatch => {
// If we are doing this in the background, do not set loading = true
if (fetchSilently) {
Lbryio.getCurrentUser().then(user => {
dispatch({
type: ACTIONS.USER_FETCH_SUCCESS,
data: { user },
});
});
} else {
dispatch({
type: ACTIONS.USER_FETCH_STARTED,
});
@ -95,6 +104,7 @@ export function doUserFetch() {
data: { error },
});
});
}
};
}