diff --git a/.changeset/chilled-feet-marry.md b/.changeset/chilled-feet-marry.md new file mode 100644 index 0000000000..ba1abaada5 --- /dev/null +++ b/.changeset/chilled-feet-marry.md @@ -0,0 +1,5 @@ +--- +'remotedev-redux-devtools-extension': patch +--- + +Fix mocking Chrome API for Electron diff --git a/extension/src/app/Actions.tsx b/extension/src/app/Actions.tsx index 216e59afab..656bb6d67f 100644 --- a/extension/src/app/Actions.tsx +++ b/extension/src/app/Actions.tsx @@ -29,11 +29,7 @@ interface OwnProps { } type Props = StateProps & DispatchProps & OwnProps; -declare global { - interface Window { - isElectron?: boolean; - } -} +const isElectron = navigator.userAgent.includes('Electron'); function sendMessage(message: SingleMessage) { chrome.runtime.sendMessage(message); @@ -98,7 +94,7 @@ class Actions extends Component { )} - {!window.isElectron && ( + {!isElectron && ( )} - {!window.isElectron && ( + {!isElectron && (