Skip to content

Commit

Permalink
Add ENVIRONMENT_TYPE_NOTIFICATION check
Browse files Browse the repository at this point in the history
  • Loading branch information
rickycodes committed Nov 5, 2019
1 parent 0fafde0 commit be89bad
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import PropTypes from 'prop-types'
import React, {PureComponent} from 'react'
import { ProviderPageContainerContent, ProviderPageContainerHeader } from '.'
import { PageContainerFooter } from '../../ui/page-container'
import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../../app/scripts/lib/enums'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util'

export default class ProviderPageContainer extends PureComponent {
static propTypes = {
Expand All @@ -20,7 +22,9 @@ export default class ProviderPageContainer extends PureComponent {
};

componentDidMount () {
window.addEventListener('beforeunload', this.onCancel)
if (getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_NOTIFICATION) {
window.addEventListener('beforeunload', this.onCancel)
}
this.context.metricsEvent({
eventOpts: {
category: 'Auth',
Expand Down

0 comments on commit be89bad

Please sign in to comment.