diff options
author | Noah I <gh@negaex.com> | 2018-11-09 20:14:32 +0800 |
---|---|---|
committer | Paul Bouchon <mail@bitpshr.net> | 2018-11-09 20:14:32 +0800 |
commit | 8bed073f209a178d73d0a04cc72df034993b0998 (patch) | |
tree | 201d2a9c9d59432e9145bab7f294e69333e47c01 | |
parent | e53ceb6bc1182ee53f4fbba2308aaf25c76efcd9 (diff) | |
download | tangerine-wallet-browser-8bed073f209a178d73d0a04cc72df034993b0998.tar.gz tangerine-wallet-browser-8bed073f209a178d73d0a04cc72df034993b0998.tar.zst tangerine-wallet-browser-8bed073f209a178d73d0a04cc72df034993b0998.zip |
1102: Fix inpage listener syntax (#5708) (#5709)
-rw-r--r-- | app/scripts/inpage.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js index a7c0b0416..cfcf5e364 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -30,8 +30,8 @@ console.warn('ATTENTION: In an effort to improve user privacy, MetaMask ' + * @param {boolean} remove - removes this handler after being triggered */ function onMessage(messageType, handler, remove) { - window.addEventListener('message', function ({ data: { type } }) { - if (type !== messageType) { return } + window.addEventListener('message', function ({ data }) { + if (!data || data.type !== messageType) { return } remove && window.removeEventListener('message', handler) handler.apply(window, arguments) }) |