|
|
@ -10,10 +10,12 @@ import { |
|
|
|
getConnectedDomainsForSelectedAddress, |
|
|
|
getConnectedDomainsForSelectedAddress, |
|
|
|
getCurrentAccountWithSendEtherInfo, |
|
|
|
getCurrentAccountWithSendEtherInfo, |
|
|
|
getOriginOfCurrentTab, |
|
|
|
getOriginOfCurrentTab, |
|
|
|
getPermissionsDomains, |
|
|
|
|
|
|
|
getPermittedAccountsByOrigin, |
|
|
|
|
|
|
|
getSelectedAddress, |
|
|
|
getSelectedAddress, |
|
|
|
} from '../../selectors/selectors' |
|
|
|
} from '../../selectors/selectors' |
|
|
|
|
|
|
|
import { |
|
|
|
|
|
|
|
getPermissionsDomains, |
|
|
|
|
|
|
|
getPermittedAccountsByOrigin, |
|
|
|
|
|
|
|
} from '../../selectors/permissions' |
|
|
|
import { DEFAULT_ROUTE } from '../../helpers/constants/routes' |
|
|
|
import { DEFAULT_ROUTE } from '../../helpers/constants/routes' |
|
|
|
import { getOriginFromUrl } from '../../helpers/utils/util' |
|
|
|
import { getOriginFromUrl } from '../../helpers/utils/util' |
|
|
|
|
|
|
|
|
|
|
@ -25,12 +27,12 @@ const mapStateToProps = (state) => { |
|
|
|
const permittedAccountsByOrigin = getPermittedAccountsByOrigin(state) |
|
|
|
const permittedAccountsByOrigin = getPermittedAccountsByOrigin(state) |
|
|
|
const selectedAddress = getSelectedAddress(state) |
|
|
|
const selectedAddress = getSelectedAddress(state) |
|
|
|
|
|
|
|
|
|
|
|
const currentTabHasAccounts = permittedAccountsByOrigin[ |
|
|
|
const currentTabHasNoAccounts = !permittedAccountsByOrigin[ |
|
|
|
originOfCurrentTab |
|
|
|
originOfCurrentTab |
|
|
|
]?.length |
|
|
|
]?.length |
|
|
|
|
|
|
|
|
|
|
|
let tabToConnect |
|
|
|
let tabToConnect |
|
|
|
if (url && !currentTabHasAccounts && !openMetaMaskTabs[id]) { |
|
|
|
if (url && currentTabHasNoAccounts && !openMetaMaskTabs[id]) { |
|
|
|
tabToConnect = { |
|
|
|
tabToConnect = { |
|
|
|
title, |
|
|
|
title, |
|
|
|
origin: getOriginFromUrl(url), |
|
|
|
origin: getOriginFromUrl(url), |
|
|
|