Commit ecbebae6 authored by Eric Seigne's avatar Eric Seigne
Browse files

reset vehicules

parent e28734a7
......@@ -225,7 +225,7 @@ function updateLocalUserFromServerSuccessMessage(code){ons.notification.alert('D
function updateLocalUserFromServerSuccess(resultBool){if(globalMyNavigator!==undefined){gotoPage('menu.html');}}
function updateLocalUserFromServer(result,callback){myDebug("=== updateLocalUserFromServer / "+callback+"===");let ret=false;if((typeof result!='undefined')&&(result!==null)&&(result!="")){for(let key of globalSrvKeys){myDebug("updateLocalUserFromServer: on cherche "+key);if((typeof result.data!='undefined')&&(result.data!==null)&&(result.data!="")){if((typeof result.data[key]!='undefined')&&(result.data[key]!==null)&&(result.data[key]!="")){myDebug(" valeur non nulle on la stocke : "+key+" = "+result.data[key]);localStoreData(key,result.data[key]);ret=true;}}
else{if((typeof result[key]!='undefined')&&(result[key]!==null)&&(result[key]!="")){localStoreData(key,result[key]);ret=true;}}}
myDebug(" on cherche si on a des vehicules ...");myDebug(result.vehicules);if((typeof result.vehicules!='undefined')&&(result.vehicules!==null)&&(result.vehicules!="")){myDebug(" on a des vehicules ...");localStoreData("vehicules",null);localStoreData("vehiculesPro",null);result.vehicules.forEach((v,key)=>{let storageKey="vehiculesPro"
myDebug(" on cherche si on a des vehicules ...");myDebug(result.vehicules);localStoreData("vehicules",null);localStoreData("vehiculesPro",null);if((typeof result.vehicules!='undefined')&&(result.vehicules!==null)&&(result.vehicules!="")){myDebug(" on a des vehicules ...");result.vehicules.forEach((v,key)=>{let storageKey="vehiculesPro"
if(v.is_perso)
storageKey="vehicules";addVehicule(storageKey,v.name,v.energy,v.power,v.type,v.kmbefore,v.number,v.uuid);});ret=true;}
if(compareVersions(localGetData("official_app_version"),globalAppVersion)>0){myDebug("index.html : "+localGetData("official_app_message"));ons.notification.alert(localGetData("official_app_message"),{title:"Nouvelle version"});}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment