← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8881: mobile: more fixes

 

------------------------------------------------------------
revno: 8881
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-11-05 14:54:36 +0100
message:
  mobile: more fixes
modified:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/js/dhis2.storage.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/js/dhis2.storage.js'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/js/dhis2.storage.js	2012-11-05 13:46:31 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/dhis-web-mobile-resources/js/dhis2.storage.js	2012-11-05 13:54:36 +0000
@@ -64,8 +64,10 @@
 
 dhis2.storage.FormManager.prototype.organisationUnits = function () {
     if ( this._organisationUnits === undefined ) {
-        if( localStorage.getItem('organisationUnits') ) {
-            this._organisationUnits = JSON.parse(localStorage.getItem('organisationUnits'));
+        var organisationUnits = localStorage.getItem('organisationUnits');
+
+        if( organisationUnits != null && organisationUnits != "null" ) {
+            this._organisationUnits = JSON.parse(organisationUnits);
         }
     }
 
@@ -83,8 +85,10 @@
 
 dhis2.storage.FormManager.prototype.forms = function () {
     if( this._forms === undefined ) {
-        if( localStorage.getItem('forms') ) {
-            this._forms = JSON.parse( localStorage.getItem('forms') );
+        var form = localStorage.getItem('forms');
+
+        if( form != null && form != "null") {
+            this._forms = JSON.parse( form );
         }
     }
 
@@ -98,7 +102,7 @@
 dhis2.storage.FormManager.prototype.dataValueSets = function() {
     var dataValueSets = localStorage.getItem('dataValueSets');
 
-    if(dataValueSets !== undefined )
+    if( dataValueSets != null && dataValueSets != "null" )
     {
         dataValueSets = JSON.parse( dataValueSets );
     } else {