Show Button, when Upgrade Version is available ! (check from the server, the version number

- for debug: added led button to see when is calling the server and the IndexedDb.
This commit is contained in:
Paolo Arena
2019-02-22 10:23:00 +01:00
parent 1623a5c35d
commit 0e98ac1eaa
41 changed files with 1411 additions and 992 deletions

View File

@@ -42,7 +42,7 @@ async function Request(type: string, path: string, payload: any, setAuthToken?:
try {
console.log(`Axios Request [${type}]:`, axiosInstance.defaults)
let response: AxiosResponse
if (type === 'post' || type === 'put') {
if (type === 'post' || type === 'put' || type === 'patch') {
response = await axiosInstance[type](path, payload, {
headers: {
'Content-Type': 'application/json',
@@ -107,6 +107,11 @@ async function Request(type: string, path: string, payload: any, setAuthToken?:
}
}
catch (error) {
setTimeout(function () {
GlobalStore.state.connData.uploading_server = (GlobalStore.state.connData.uploading_server === 1) ? -1 : GlobalStore.state.connData.uploading_server
GlobalStore.state.connData.downloading_server = (GlobalStore.state.connData.downloading_server === 1) ? -1 : GlobalStore.state.connData.downloading_server
}, 1000)
if (process.env.DEV) {
console.log('ERROR using', path)
// console.log('Error received: ', error)