Przeglądaj źródła

bollow the codes from https://github.com/crowi/crowi/pull/394/files

Yuki Takei 7 lat temu
rodzic
commit
fd39e27a85
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/client/js/util/Crowi.js

+ 3 - 2
src/client/js/util/Crowi.js

@@ -101,9 +101,10 @@ export default class Crowi {
     ];
 
     keys.forEach(key => {
-      if (this.localStorage[key]) {
+      const keyContent = this.localStorage[key];
+      if (keyContent) {
         try {
-          this[key] = JSON.parse(this.localStorage[key]);
+          this[key] = JSON.parse(keyContent);
         }
         catch (e) {
           this.localStorage.removeItem(key);