Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed May 20, 2020
1 parent 99c7069 commit 3c93077
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/storage/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,16 @@ class CookieLocal {
* @param {*} key
*/
get(key) {
// if not parseable, return as is without json parse
let value;
try {
let value = cookie(key);
value = cookie(key);
value = value ? json.parse(value) : null;
return value;
} catch (e) {
if(value) {
return value
}
return null;
}
}
Expand Down

0 comments on commit 3c93077

Please sign in to comment.