]> Softwares of Agnibho - dietsurvey.git/blobdiff - src/main.js
Standardized routine.js
[dietsurvey.git] / src / main.js
index b18a14cbf2ff120da068002f499c2e9b9216ea1b..6e0dad7717c97c0ca479cac6e133dace8f4437e8 100644 (file)
@@ -53,19 +53,19 @@ new Vue({
   data: {dataObj: {family: [], food: []}, dataRef: false},
   created:function(){
     try{
-      var loc=JSON.parse(localStorage.getItem("dietsurvey_data"));
+      var loc=JSON.parse(localStorage.getItem(STORAGE));
       if(loc.version>data.version){
         this.dataRef=loc;
       }
       else{
         this.dataRef=data;
-        localStorage.setItem("dietsurvey_data", JSON.stringify(data));
+        localStorage.setItem(STORAGE, JSON.stringify(data));
       }
     }
     catch(e){
       if(!this.dataRef){
         this.dataRef=data;
-        localStorage.setItem("dietsurvey_data", JSON.stringify(data));
+        localStorage.setItem(STORAGE, JSON.stringify(data));
       }
     }
   }