Skip to content

Commit

Permalink
Version v12.10.2 RC (#29875)
Browse files Browse the repository at this point in the history
📦 🚀

---------

Co-authored-by: MetaMask Bot <[email protected]>
Co-authored-by: Matthew Walsh <[email protected]>
Co-authored-by: Micaela Estabillo <[email protected]>
Co-authored-by: Dan J Miller <[email protected]>
Co-authored-by: Nidhi Kumari <[email protected]>
Co-authored-by: Derek Brans <[email protected]>
  • Loading branch information
7 people authored Jan 24, 2025
1 parent 0030453 commit 9456967
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 16 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [12.10.2]
### Fixed
- Updated permissions header to be consistent (#29880) ([#29880](https://github.com/MetaMask/metamask-extension/pull/29880))
- Fixed Route to bridge page from swaps ([#29883](https://github.com/MetaMask/metamask-extension/pull/29883))
- Re-added missing smart transaction status confirmation (#29860) ([#29860](https://github.com/MetaMask/metamask-extension/pull/29860))


## [12.10.1]
### Changed
- Stop publishing MMI builds to the release page ([#29732](https://github.com/MetaMask/metamask-extension/pull/29732))
Expand Down Expand Up @@ -5557,7 +5564,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
- Added the ability to restore accounts from seed words.


[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.10.1...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.10.2...HEAD
[12.10.2]: https://github.com/MetaMask/metamask-extension/compare/v12.10.1...v12.10.2
[12.10.1]: https://github.com/MetaMask/metamask-extension/compare/v12.10.0...v12.10.1
[12.10.0]: https://github.com/MetaMask/metamask-extension/compare/v12.9.3...v12.10.0
[12.9.3]: https://github.com/MetaMask/metamask-extension/compare/v12.9.2...v12.9.3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metamask-crx",
"version": "12.10.1",
"version": "12.10.2",
"private": true,
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion ui/hooks/bridge/useBridging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const useBridging = () => {
},
});
history.push(
`${CROSS_CHAIN_SWAP_ROUTE}${PREPARE_SWAP_ROUTE}?token=${token.address.toLowerCase()}`,
`${CROSS_CHAIN_SWAP_ROUTE}${PREPARE_SWAP_ROUTE}?token=${token.address?.toLowerCase()}`,
);
} else {
const portfolioUrl = getPortfolioUrl(
Expand Down
13 changes: 13 additions & 0 deletions ui/pages/confirmations/hooks/useConfirmationNavigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ describe('useConfirmationNavigation', () => {
);
});

it('does not navigate to template route if approval flow and pending approval', () => {
const result = renderHook(ApprovalType.Transaction, undefined, [
{} as never,
]);

result.navigateToId(APPROVAL_ID_MOCK);

expect(history.replace).toHaveBeenCalledTimes(1);
expect(history.replace).toHaveBeenCalledWith(
`${CONFIRM_TRANSACTION_ROUTE}/${APPROVAL_ID_MOCK}`,
);
});

it('navigates to connect route', () => {
const result = renderHook(ApprovalType.WalletRequestPermissions);

Expand Down
6 changes: 4 additions & 2 deletions ui/pages/confirmations/hooks/useConfirmationNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ export function navigateToConfirmation(
hasApprovalFlows: boolean,
history: ReturnType<typeof useHistory>,
) {
if (hasApprovalFlows) {
const hasNoConfirmations = confirmations?.length <= 0 || !confirmationId;

if (hasApprovalFlows && hasNoConfirmations) {
history.replace(`${CONFIRMATION_V_NEXT_ROUTE}`);
return;
}

if (confirmations?.length <= 0 || !confirmationId) {
if (hasNoConfirmations) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions ui/pages/home/home.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ export default class Home extends PureComponent {
history.push(AWAITING_SWAP_ROUTE);
} else if (canRedirect && (haveSwapsQuotes || swapsFetchParams)) {
history.push(PREPARE_SWAP_ROUTE);
} else if (pendingApprovals.length) {
} else if (pendingApprovals.length || hasApprovalFlows) {
navigateToConfirmation(
pendingApprovals[0].id,
pendingApprovals?.[0]?.id,
pendingApprovals,
hasApprovalFlows,
history,
Expand Down
32 changes: 24 additions & 8 deletions ui/pages/permissions-connect/permissions-connect.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ export default class PermissionConnect extends Component {
this.props.permissionsRequest,
),
permissionsApproved: null,
origin: this.props.origin,
targetSubjectMetadata: this.props.targetSubjectMetadata || {},
snapsInstallPrivacyWarningShown: this.props.snapsInstallPrivacyWarningShown,
};

componentDidMount() {
Expand All @@ -148,6 +151,7 @@ export default class PermissionConnect extends Component {
history.replace(DEFAULT_ROUTE);
return;
}

// if this is an incremental permission request for permitted chains, skip the account selection
if (
permissionsRequest?.diff?.permissionDiffMap?.[
Expand All @@ -156,6 +160,7 @@ export default class PermissionConnect extends Component {
) {
history.replace(confirmPermissionPath);
}

if (history.location.pathname === connectPath && !isRequestingAccounts) {
switch (requestType) {
case 'wallet_installSnap':
Expand All @@ -177,8 +182,17 @@ export default class PermissionConnect extends Component {
}

componentDidUpdate(prevProps) {
const { permissionsRequest, lastConnectedInfo, origin } = this.props;
const { redirecting } = this.state;
const { permissionsRequest, lastConnectedInfo, targetSubjectMetadata } =
this.props;
const { redirecting, origin } = this.state;

// We cache the last known good targetSubjectMetadata since it may be null when the approval is cleared
if (
targetSubjectMetadata?.origin &&
prevProps.targetSubjectMetadata?.origin !== targetSubjectMetadata?.origin
) {
this.setState({ targetSubjectMetadata });
}

if (!permissionsRequest && prevProps.permissionsRequest && !redirecting) {
const accountsLastApprovedTime =
Expand Down Expand Up @@ -264,7 +278,7 @@ export default class PermissionConnect extends Component {
}

renderTopBar(permissionsRequestId) {
const { targetSubjectMetadata } = this.props;
const { targetSubjectMetadata } = this.state;
const handleCancelFromHeader = () => {
this.cancelPermissionsRequest(permissionsRequestId);
};
Expand Down Expand Up @@ -321,12 +335,14 @@ export default class PermissionConnect extends Component {
rejectPendingApproval,
setSnapsInstallPrivacyWarningShownStatus,
approvePermissionsRequest,
snapsInstallPrivacyWarningShown,
origin,
history,
} = this.props;
const { selectedAccountAddresses, permissionsApproved, redirecting } =
this.state;
const {
selectedAccountAddresses,
permissionsApproved,
redirecting,
snapsInstallPrivacyWarningShown,
} = this.state;

const isRequestingSnap = isSnapId(permissionsRequest?.metadata?.origin);

Expand Down Expand Up @@ -368,7 +384,7 @@ export default class PermissionConnect extends Component {
rejectPermissionsRequest={(requestId) =>
this.cancelPermissionsRequest(requestId)
}
activeTabOrigin={origin}
activeTabOrigin={this.state.origin}
request={permissionsRequest}
permissionsRequestId={permissionsRequestId}
approveConnection={this.approveConnection}
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/swaps/prepare-swap-page/prepare-swap-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ export default function PrepareSwapPage({
marginTop={2}
fontWeight={FontWeight.Normal}
onClick={() => {
openBridgeExperience('Swaps', fromToken);
openBridgeExperience('Swaps', selectedFromToken);
}}
target="_blank"
data-testid="prepare-swap-page-cross-chain-swaps-link"
Expand Down

0 comments on commit 9456967

Please sign in to comment.