diff --git a/ui/app/components/app/signature-request-original.js b/ui/app/components/app/signature-request-original.js index 60b910eb0..e23d724cb 100644 --- a/ui/app/components/app/signature-request-original.js +++ b/ui/app/components/app/signature-request-original.js @@ -101,9 +101,10 @@ function SignatureRequest (props) { this.state = { selectedAccount: props.selectedAccount, } + this._beforeUnload = this._beforeUnload.bind(this) } -SignatureRequest.prototype._beforeUnload = (event) => { +SignatureRequest.prototype._beforeUnload = function (event) { const { clearConfirmTransaction, cancel } = this.props const { metricsEvent } = this.context metricsEvent({ @@ -117,7 +118,7 @@ SignatureRequest.prototype._beforeUnload = (event) => { cancel(event) } -SignatureRequest.prototype._removeBeforeUnload = () => { +SignatureRequest.prototype._removeBeforeUnload = function () { if (getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_NOTIFICATION) { window.removeEventListener('beforeunload', this._beforeUnload) }