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 {
189189
190190 /** Loads persisted data from localStorage */
191191 private _load ( ) {
192+ // do nothing if localStorage is not available
193+ if ( typeof localStorage === 'undefined' ) return ;
194+
192195 try {
193196 const key = `${ STORAGE_KEY } :${ this . namespace } ` ;
194197 const json = localStorage . getItem ( key ) ;
@@ -202,6 +205,9 @@ export default class LncCredentialStore implements CredentialStore {
202205
203206 /** Saves persisted data to localStorage */
204207 private _save ( ) {
208+ // do nothing if localStorage is not available
209+ if ( typeof localStorage === 'undefined' ) return ;
210+
205211 const key = `${ STORAGE_KEY } :${ this . namespace } ` ;
206212 localStorage . setItem ( key , JSON . stringify ( this . persisted ) ) ;
207213 }
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module.exports = {
2828 name : '@lightninglabs/lnc-web' ,
2929 type : "umd" , // see https://webpack.js.org/configuration/output/#outputlibrarytype
3030 } ,
31+ globalObject : 'this' ,
3132 path : path . resolve ( __dirname , 'dist' ) ,
3233 } ,
3334} ;
You can’t perform that action at this time.
0 commit comments