mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
[FLASK] Fix some issues with installing snaps that request eth_accounts(#16365)
This commit is contained in:
parent
348262f2ea
commit
121b6809f8
@ -164,11 +164,33 @@ export default class PermissionConnect extends Component {
|
||||
}
|
||||
|
||||
selectAccounts = (addresses) => {
|
||||
const {
|
||||
confirmPermissionPath,
|
||||
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
||||
snapInstallPath,
|
||||
snapUpdatePath,
|
||||
isSnap,
|
||||
permissionsRequest,
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
} = this.props;
|
||||
this.setState(
|
||||
{
|
||||
selectedAccountAddresses: addresses,
|
||||
},
|
||||
() => this.props.history.push(this.props.confirmPermissionPath),
|
||||
///: BEGIN:ONLY_INCLUDE_IN(main,beta)
|
||||
() => this.props.history.push(confirmPermissionPath),
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
||||
() =>
|
||||
this.props.history.push(
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
isSnap
|
||||
? permissionsRequest.newPermissions
|
||||
? snapUpdatePath
|
||||
: snapInstallPath
|
||||
: confirmPermissionPath,
|
||||
),
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
);
|
||||
};
|
||||
|
||||
@ -315,7 +337,7 @@ export default class PermissionConnect extends Component {
|
||||
approveSnapInstall={(requestId) => {
|
||||
approvePendingApproval(requestId, {
|
||||
...permissionsRequest,
|
||||
approvedAccounts: selectedAccountAddresses,
|
||||
approvedAccounts: [...selectedAccountAddresses],
|
||||
});
|
||||
this.redirect(true);
|
||||
}}
|
||||
@ -345,7 +367,7 @@ export default class PermissionConnect extends Component {
|
||||
approveSnapUpdate={(requestId) => {
|
||||
approvePendingApproval(requestId, {
|
||||
...permissionsRequest,
|
||||
approvedAccounts: selectedAccountAddresses,
|
||||
approvedAccounts: [...selectedAccountAddresses],
|
||||
});
|
||||
this.redirect(true);
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user