diff options
Diffstat (limited to 'src/services/storage.service.js')
-rw-r--r-- | src/services/storage.service.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/services/storage.service.js b/src/services/storage.service.js index c41d552..d29a1e5 100644 --- a/src/services/storage.service.js +++ b/src/services/storage.service.js @@ -9,7 +9,8 @@ class Storage{ if(!key||!value){ throw("Storag.set expects a 'key' and a 'value' - 'value' & 'key' can't be null"); } - localStorage.setItem(key, JSON.stringify(value)); + value = (typeof value=="string") ? value : JSON.stringify(value); + localStorage.setItem(key, value); } } |