Commit c761ed80 authored by Michał "rysiek" Woźniak's avatar Michał "rysiek" Woźniak 🔒

bugfix for gun-ipfs: window needs to be set in global scope

parent 1aaea188
......@@ -7,6 +7,15 @@
*/
/**
* this is apparently needed by Gun
* `window` does not exist in ServiceWorker context
*/
if (typeof window === 'undefined') {
var window = self;
}
/* ========================================================================= *\
|* === General stuff and setup === *|
\* ========================================================================= */
......@@ -39,14 +48,6 @@
throw err
}
/**
* this is apparently needed by Gun
* and `window` does not exist in ServiceWorker context
*/
if (typeof window === 'undefined') {
var window = self;
}
/**
* importing stuff works differently between a browser window context
* and a ServiceWorker context, because things just can't be easy and sane
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment