fix for session promise issue

This commit is contained in:
Ben Wheeler 2020-01-09 07:41:16 -05:00
parent 7b46ddf243
commit 6654362b2c

View file

@ -99,20 +99,20 @@ const handleSessionResponse = (dispatch, body) => {
module.exports.refreshSession = () => (dispatch => { module.exports.refreshSession = () => (dispatch => {
dispatch(module.exports.setStatus(module.exports.Status.FETCHING)); dispatch(module.exports.setStatus(module.exports.Status.FETCHING));
return new Promise((resolve, reject) => ( return new Promise((resolve, reject) => {
requestSession(resolve, reject).then(body => { requestSession(resolve, reject);
}).then(body => {
handleSessionResponse(dispatch, body); handleSessionResponse(dispatch, body);
}, err => { }, err => {
dispatch(module.exports.setSessionError(err)); dispatch(module.exports.setSessionError(err));
}) });
));
}); });
module.exports.refreshSessionWithRetry = () => (dispatch => { module.exports.refreshSessionWithRetry = () => (dispatch => {
dispatch(module.exports.setStatus(module.exports.Status.FETCHING)); dispatch(module.exports.setStatus(module.exports.Status.FETCHING));
return new Promise((resolve, reject) => ( return new Promise((resolve, reject) => {
requestSessionWithRetry(resolve, reject, 4, 7500) requestSessionWithRetry(resolve, reject, 4, 7500);
)).then(body => { }).then(body => {
handleSessionResponse(dispatch, body); handleSessionResponse(dispatch, body);
}, err => { }, err => {
dispatch(module.exports.setSessionError(err)); dispatch(module.exports.setSessionError(err));