Comparing version 0.0.31 to 0.0.32
27
index.js
@@ -60,3 +60,3 @@ import axios from 'axios' | ||
}, | ||
async callSrv (method, path, params) { | ||
async callSrv (method, path, params, saf = false) { | ||
const netRes = await Network.getStatus() //'wifi' | 'cellular' | 'none' | 'unknown' | ||
@@ -74,3 +74,26 @@ const status = netRes.connectionType | ||
else { | ||
throw new Error('offline') | ||
if (saf) { | ||
Notify.create({ | ||
message: "Se encuentra sin coberturda de internet. La grabación se almacena hasta tener nuevamente cobertura y se enviará automaticamente.", | ||
color: 'black-6', | ||
progress: true, | ||
multiLine: true, | ||
textColor: 'white', | ||
icon: 'error', | ||
timeout: 10000, | ||
}) | ||
const pl = [{ | ||
method, | ||
path, | ||
params | ||
}] | ||
const fileSaf = await connector.getFile('saf.txt') | ||
if (fileSaf) { | ||
const json = JSON.parse(fileSaf) | ||
pl = json.concat(pl) | ||
} | ||
connector.setFile('saf.txt', pl) | ||
} | ||
else | ||
throw new Error('offline') | ||
} | ||
@@ -77,0 +100,0 @@ }, |
{ | ||
"name": "fwk-api", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "Framework with api services access(only javascript)", | ||
@@ -17,4 +17,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"axios": "^0.26.1" | ||
"axios": "^0.26.1", | ||
"fwk-connector": "0.0.1" | ||
} | ||
} |
4001
115
2
+ Addedfwk-connector@0.0.1
+ Addedfwk-connector@0.0.1(transitive)