Still working on network online offline detection...

This commit is contained in:
Scott Idem
2020-03-06 10:19:50 -05:00
parent bb492e8f71
commit 988eceb13e
9 changed files with 119 additions and 85 deletions

View File

@@ -7,20 +7,13 @@ async function api_token_request_async(axios, secret_key) {
} else {
}
if (navigator.onLine) {
} else {
app_online = false;
return false;
}
waiting_on_api_token = true;
const url = '/api_token_request';
let data = { secret_key: secret_key };
const response = await axios.post(url, data)
const result = await axios.post(url, data)
.then(function (response) {
//console.log(response);
const api_temporary_token = response.data.temporary_token;
@@ -33,7 +26,7 @@ async function api_token_request_async(axios, secret_key) {
});
waiting_on_api_token = false;
return response;
return result;
}