mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-25 16:48:10 -05:00
fix for session promise issue
This commit is contained in:
parent
7b46ddf243
commit
6654362b2c
1 changed files with 14 additions and 14 deletions
|
@ -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);
|
||||||
handleSessionResponse(dispatch, body);
|
}).then(body => {
|
||||||
}, err => {
|
handleSessionResponse(dispatch, body);
|
||||||
dispatch(module.exports.setSessionError(err));
|
}, 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));
|
||||||
|
|
Loading…
Reference in a new issue