Skip to content

Commit

Permalink
fix: used globalThis instead of window inside the dev tool
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroerta committed Jul 1, 2021
1 parent 0c18f58 commit 6f028eb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/dev-tools/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { theme } from '@morfeo/web';

export function enableMorfeoDevTool() {
theme.subscribe(newTheme => {
// @ts-ignore
window.postMessage({
type: MORFEO_DEVTOOLS,
theme: newTheme,
});
if (globalThis && globalThis.postMessage) {
globalThis.postMessage({
type: MORFEO_DEVTOOLS,
theme: newTheme,
});
}
});
}

0 comments on commit 6f028eb

Please sign in to comment.