shorter timeout

This commit is contained in:
zeppi 2021-01-19 12:01:01 -05:00 committed by Sean Yesmunt
parent a2d93bc7cc
commit 6ed103b33f

View file

@ -9,8 +9,8 @@ import { DOMAIN } from 'config';
import { getDefaultLanguage } from 'util/default-languages'; import { getDefaultLanguage } from 'util/default-languages';
const AUTH_IN_PROGRESS = 'authInProgress'; const AUTH_IN_PROGRESS = 'authInProgress';
export let sessionStorageAvailable = false; export let sessionStorageAvailable = false;
const POINT_TWO_SECONDS = 200; const CHECK_INTERVAL = 200;
const THIRTY_SECONDS = 30000; const AUTH_WAIT_TIMEOUT = 10000;
export function doFetchInviteStatus(shouldCallRewardList = true) { export function doFetchInviteStatus(shouldCallRewardList = true) {
return dispatch => { return dispatch => {
@ -113,8 +113,8 @@ function checkAuthBusy() {
window.sessionStorage.setItem(AUTH_IN_PROGRESS, 'true'); window.sessionStorage.setItem(AUTH_IN_PROGRESS, 'true');
return resolve(); return resolve();
} else { } else {
if (Date.now() - time < THIRTY_SECONDS) { if (Date.now() - time < AUTH_WAIT_TIMEOUT) {
setTimeout(waitForAuth, POINT_TWO_SECONDS); setTimeout(waitForAuth, CHECK_INTERVAL);
} else { } else {
return resolve(); return resolve();
} }