mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
select current address in permissions connect (#8811)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
This commit is contained in:
parent
0813cc5c88
commit
53e88b06b6
@ -415,8 +415,6 @@ describe('MetaMask', function () {
|
||||
|
||||
await driver.delay(regularDelayMs)
|
||||
|
||||
await driver.clickElement(By.css('.permissions-connect-choose-account__account'))
|
||||
|
||||
await driver.clickElement(By.xpath(`//button[contains(text(), 'Next')]`))
|
||||
await driver.clickElement(By.xpath(`//button[contains(text(), 'Connect')]`))
|
||||
|
||||
|
@ -17,6 +17,7 @@ export default class PermissionConnect extends Component {
|
||||
getRequestAccountTabIds: PropTypes.func.isRequired,
|
||||
getCurrentWindowTab: PropTypes.func.isRequired,
|
||||
accounts: PropTypes.array.isRequired,
|
||||
currentAddress: PropTypes.string.isRequired,
|
||||
origin: PropTypes.string,
|
||||
showNewAccountModal: PropTypes.func.isRequired,
|
||||
newAccountNumber: PropTypes.number.isRequired,
|
||||
@ -46,9 +47,7 @@ export default class PermissionConnect extends Component {
|
||||
|
||||
state = {
|
||||
redirecting: false,
|
||||
selectedAccountAddresses: this.props.accounts.length === 1
|
||||
? new Set([this.props.accounts[0].address])
|
||||
: new Set(),
|
||||
selectedAccountAddresses: new Set([this.props.currentAddress]),
|
||||
permissionsApproved: null,
|
||||
origin: this.props.origin,
|
||||
targetDomainMetadata: this.props.targetDomainMetadata || {},
|
||||
|
@ -7,6 +7,7 @@ import {
|
||||
getAccountsWithLabels,
|
||||
getLastConnectedInfo,
|
||||
getTargetDomainMetadata,
|
||||
getSelectedAddress,
|
||||
} from '../../selectors'
|
||||
|
||||
import { formatDate } from '../../helpers/utils/util'
|
||||
@ -28,6 +29,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
location: { pathname },
|
||||
} = ownProps
|
||||
const permissionsRequests = getPermissionsRequests(state)
|
||||
const currentAddress = getSelectedAddress(state)
|
||||
|
||||
const permissionsRequest = permissionsRequests
|
||||
.find((permissionsRequest) => permissionsRequest.metadata.id === permissionsRequestId)
|
||||
@ -68,6 +70,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
permissionsRequestId,
|
||||
hasPendingPermissionsRequests,
|
||||
accounts: accountsWithLabels,
|
||||
currentAddress,
|
||||
origin,
|
||||
newAccountNumber: accountsWithLabels.length + 1,
|
||||
nativeCurrency,
|
||||
|
Loading…
Reference in New Issue
Block a user