1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

handle onDisconnect

This commit is contained in:
brunobar79 2018-08-22 13:39:43 -04:00
parent 055e0f8dac
commit fdff768549

View File

@ -6,6 +6,10 @@ let port = chrome.runtime.connect({ name: 'trezor-connect' });
port.onMessage.addListener(message => {
window.postMessage(message, window.location.origin);
});
port.onDisconnect.addListener(d => {
port = null;
});
/*
Passing messages from popup to background script
*/