Skip to content

Commit

Permalink
fix(app): prevent message on beforeunload from showing
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
JamieMason committed Feb 15, 2019
1 parent 7c0ea0d commit 7d94490
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const disableDragAndDrop = () => {
});
};

const disableExitDialog = () => {
Object.defineProperties(window, {
onbeforeunload: {
set() {},
},
});
};

const getReduxStore = () =>
document.getElementById('container')._reactRootContainer._internalRoot.current
.child.memoizedProps.store;
Expand Down Expand Up @@ -57,5 +65,6 @@ const run = () => {
};

disableDragAndDrop();
disableExitDialog();

window.addEventListener('load', run, false);

0 comments on commit 7d94490

Please sign in to comment.