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 => {
dispatch(module.exports.setStatus(module.exports.Status.FETCHING));
return new Promise((resolve, reject) => (
requestSession(resolve, reject).then(body => {
handleSessionResponse(dispatch, body);
}, err => {
dispatch(module.exports.setSessionError(err));
})
));
});
module.exports.refreshSessionWithRetry = () => (dispatch => {
dispatch(module.exports.setStatus(module.exports.Status.FETCHING));
return new Promise((resolve, reject) => (
requestSessionWithRetry(resolve, reject, 4, 7500)
)).then(body => {
return new Promise((resolve, reject) => {
requestSession(resolve, reject);
}).then(body => {
handleSessionResponse(dispatch, body);
}, err => {
dispatch(module.exports.setSessionError(err));
});
});
module.exports.refreshSessionWithRetry = () => (dispatch => {
dispatch(module.exports.setStatus(module.exports.Status.FETCHING));
return new Promise((resolve, reject) => {
requestSessionWithRetry(resolve, reject, 4, 7500);
}).then(body => {
handleSessionResponse(dispatch, body);
}, err => {
dispatch(module.exports.setSessionError(err));