|
|
@ -233,13 +233,11 @@ function setupController (initState, initLangCode) { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// MetaMask Controller
|
|
|
|
// MetaMask Controller
|
|
|
|
//
|
|
|
|
//
|
|
|
|
const { ABTestController = {} } = initState |
|
|
|
|
|
|
|
const { abTests = {} } = ABTestController |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const controller = new MetamaskController({ |
|
|
|
const controller = new MetamaskController({ |
|
|
|
// User confirmation callbacks:
|
|
|
|
// User confirmation callbacks:
|
|
|
|
showUnconfirmedMessage: triggerUi, |
|
|
|
showUnconfirmedMessage: triggerUi, |
|
|
|
showUnapprovedTx: abTests.fullScreenVsPopup === 'fullScreen' ? triggerUiInNewTab : triggerUi, |
|
|
|
showUnapprovedTx: triggerUi, |
|
|
|
openPopup: openPopup, |
|
|
|
openPopup: openPopup, |
|
|
|
closePopup: notificationManager.closePopup.bind(notificationManager), |
|
|
|
closePopup: notificationManager.closePopup.bind(notificationManager), |
|
|
|
// initial state
|
|
|
|
// initial state
|
|
|
@ -443,20 +441,6 @@ function triggerUi () { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Opens a new browser tab for user confirmation |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
function triggerUiInNewTab () { |
|
|
|
|
|
|
|
const tabIdsArray = Object.keys(openMetamaskTabsIDs) |
|
|
|
|
|
|
|
if (tabIdsArray.length) { |
|
|
|
|
|
|
|
extension.tabs.update(parseInt(tabIdsArray[0], 10), { 'active': true }, () => { |
|
|
|
|
|
|
|
extension.tabs.reload(parseInt(tabIdsArray[0], 10)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
platform.openExtensionInBrowser() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Opens the browser popup for user confirmation of watchAsset |
|
|
|
* Opens the browser popup for user confirmation of watchAsset |
|
|
|
* then it waits until user interact with the UI |
|
|
|
* then it waits until user interact with the UI |
|
|
|