From 6654362b2c51f4c666f13614c9348186c0154e07 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Thu, 9 Jan 2020 07:41:16 -0500 Subject: [PATCH] fix for session promise issue --- src/redux/session.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/redux/session.js b/src/redux/session.js index a0d951a07..9e16b5241 100644 --- a/src/redux/session.js +++ b/src/redux/session.js @@ -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));