File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ export default class LncCredentialStore implements CredentialStore {
189
189
190
190
/** Loads persisted data from localStorage */
191
191
private _load ( ) {
192
+ // do nothing if localStorage is not available
193
+ if ( typeof localStorage === 'undefined' ) return ;
194
+
192
195
try {
193
196
const key = `${ STORAGE_KEY } :${ this . namespace } ` ;
194
197
const json = localStorage . getItem ( key ) ;
@@ -202,6 +205,9 @@ export default class LncCredentialStore implements CredentialStore {
202
205
203
206
/** Saves persisted data to localStorage */
204
207
private _save ( ) {
208
+ // do nothing if localStorage is not available
209
+ if ( typeof localStorage === 'undefined' ) return ;
210
+
205
211
const key = `${ STORAGE_KEY } :${ this . namespace } ` ;
206
212
localStorage . setItem ( key , JSON . stringify ( this . persisted ) ) ;
207
213
}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module.exports = {
28
28
name : '@lightninglabs/lnc-web' ,
29
29
type : "umd" , // see https://webpack.js.org/configuration/output/#outputlibrarytype
30
30
} ,
31
+ globalObject : 'this' ,
31
32
path : path . resolve ( __dirname , 'dist' ) ,
32
33
} ,
33
34
} ;
You can’t perform that action at this time.
0 commit comments