1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

only run beforeunload in notification UI

This commit is contained in:
Erik Marks 2020-06-10 22:13:55 -07:00
parent c090bc7f40
commit 222ccd9d44

View File

@ -68,10 +68,7 @@ export default class PermissionConnect extends Component {
removeBeforeUnload = () => {
const environmentType = getEnvironmentType()
if (
environmentType === ENVIRONMENT_TYPE_FULLSCREEN ||
environmentType === ENVIRONMENT_TYPE_NOTIFICATION
) {
if (environmentType === ENVIRONMENT_TYPE_NOTIFICATION) {
window.removeEventListener('beforeunload', this.beforeUnload)
}
}
@ -91,10 +88,7 @@ export default class PermissionConnect extends Component {
}
const environmentType = getEnvironmentType()
if (
environmentType === ENVIRONMENT_TYPE_FULLSCREEN ||
environmentType === ENVIRONMENT_TYPE_NOTIFICATION
) {
if (environmentType === ENVIRONMENT_TYPE_NOTIFICATION) {
window.addEventListener('beforeunload', this.beforeUnload)
}
}