Skip to content

Commit

Permalink
Merge pull request aws-amplify#636 from elorzafe/master
Browse files Browse the repository at this point in the history
Fix problem with Polyfills
  • Loading branch information
elorzafe authored Apr 11, 2018
2 parents 9e34ef0 + 321d830 commit 35fa9b8
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/aws-amplify/src/Common/Polyfills/Polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@

import InMemoryCache from '../../Cache/InMemoryCache';

(<any>global).window = (<any>global).window || {
setTimeout,
clearTimeout,
WebSocket: (<any>global).WebSocket,
ArrayBuffer: (<any>global).ArrayBuffer,
addEventListener(){ },
navigator: { onLine: true }
};
(<any>global).localStorage = (<any>global).localStorage || InMemoryCache;

if (!(<any>global).window) {
(<any>global).window = {
setTimeout,
clearTimeout,
WebSocket: (<any>global).WebSocket,
ArrayBuffer: (<any>global).ArrayBuffer,
addEventListener(){ },
navigator: { onLine: true }
};
}
if (!(<any>global).localStorage) {
(<any>global).localStorage = InMemoryCache;
}

0 comments on commit 35fa9b8

Please sign in to comment.