jmuehlner commented on code in PR #778:
URL: https://github.com/apache/guacamole-client/pull/778#discussion_r1035292886


##########
guacamole/src/main/frontend/src/app/storage/services/localStorageService.js:
##########
@@ -119,25 +140,56 @@ angular.module('storage').provider('localStorageService', 
[function localStorage
         }
         catch (ignore) {}
 
-        // Pull and parse value from internal storage, if present
+        // Pull from internal storage, if present
         var data = storedItems[key];
         if (data)
-            return JSON.parse(data);
+            return data;
 
         // No value defined for given key
         return null;
 
     };
 
+    /**
+     * Retrieves the JSON-serialized value currently stored within localStorage
+     * for the item having the given key. If access to localStorage is not
+     * provided/implemented by the browser, the item is retrieved from
+     * internal, in-memory storage. The retrieved value is automatically
+     * deserialized from JSON prior to being returned.
+     *
+     * @param {String} key
+     *     The arbitrary, unique key of the item to retrieve from localStorage.
+     *
+     * @returns {Object}
+     *     The value stored within localStorage under the given key,
+     *     automatically deserialized from JSON, or null if no such item is
+     *     present.
+     */
+    provider.getJsonItem = function getJsonItem(key) {

Review Comment:
   Oh yeah, having the existing methods just handle both is a much better idea. 
I'll do that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to