Check response

This commit is contained in:
Ildar Kamalov 2019-02-19 19:42:59 +03:00
parent 340a4fb58e
commit f0536b6347
1 changed files with 5 additions and 3 deletions

View File

@ -160,9 +160,11 @@ export const redirectToCurrentProtocol = (values) => {
// TODO // TODO
const redirectCheck = setInterval(() => { const redirectCheck = setInterval(() => {
fetch(`https://${hostname}${httpsPort}/${hash}`, { mode: 'no-cors' }) fetch(`https://${hostname}${httpsPort}/${hash}`, { mode: 'no-cors' })
.then(() => { .then((response) => {
if (response) {
clearInterval(redirectCheck); clearInterval(redirectCheck);
window.location.replace(`https://${hostname}${httpsPort}/${hash}`); window.location.replace(`https://${hostname}${httpsPort}/${hash}`);
}
}) })
.catch(() => false); .catch(() => false);
}, CHECK_TIMEOUT); }, CHECK_TIMEOUT);