Skip to content
Merged

v3.2.7 #1384

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[v3.2.7](https://github.com/multiversx/mx-sdk-dapp/pull/1384)] - 2025-03-11

- [Fixed cancel action is not called on all providers](https://github.com/multiversx/mx-sdk-dapp/pull/1383)

## [[v3.2.6](https://github.com/multiversx/mx-sdk-dapp/pull/1382)] - 2025-03-11

- [Fixed sign screen layout and move decoder styles inside the package](https://github.com/multiversx/mx-sdk-dapp/pull/1381)
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": "@multiversx/sdk-dapp",
"version": "3.2.6",
"version": "3.2.7",
"description": "A library to hold the main logic for a dapp on the MultiversX blockchain",
"author": "MultiversX",
"license": "GPL-3.0-or-later",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames';
import { DataTestIdsEnum } from 'constants/index';
import { withStyles, WithStylesImportType } from 'hocs/withStyles';
import { useClearTransactionsToSignWithWarning } from 'hooks/transactions/helpers/useClearTransactionsToSignWithWarning';
import { useCancelCrossWindowAction } from 'hooks/transactions/useCancelCrossWindowAction';
import { useCancelActionAndDispose } from 'hooks/transactions/useCancelActionAndDispose';
import { SignModalPropsType } from 'types';
import { ModalContainer } from 'UI/ModalContainer/ModalContainer';
import { PageState } from 'UI/PageState';
Expand All @@ -25,7 +25,7 @@ const SignWaitingScreenModalComponent = ({
globalStyles,
styles
}: SignWaitingScreenModalPropsType & WithStylesImportType) => {
const cancelAction = useCancelCrossWindowAction();
const cancelAction = useCancelActionAndDispose();

const clearTransactionsToSignWithWarning =
useClearTransactionsToSignWithWarning();
Expand Down
4 changes: 2 additions & 2 deletions src/UI/TransactionData/TransactionData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const TransactionDataComponent = ({
};

export const TransactionData = withStyles(TransactionDataComponent, {
ssrStyles: () => import('UI/TransactionData/transactionDataStyles.scss'),
ssrStyles: () => import('UI/TransactionData/TransactionDataStyles.scss'),
clientStyles: () =>
require('UI/TransactionData/transactionDataStyles.scss').default
require('UI/TransactionData/TransactionDataStyles.scss').default
});
46 changes: 46 additions & 0 deletions src/hooks/transactions/useCancelActionAndDispose.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { useGetAccountProvider } from 'hooks/account/useGetAccountProvider';
import { LoginMethodsEnum } from 'types/enums.types';
import { getIsProviderEqualTo } from 'utils/account/getIsProviderEqualTo';
import { useCancelWalletConnectAction } from './useCancelWalletConnectAction';

export function useCancelActionAndDispose() {
const { provider } = useGetAccountProvider();
const { cancelWalletConnectAction } = useCancelWalletConnectAction();

return async () => {
if (!provider) {
return;
}

if (getIsProviderEqualTo(LoginMethodsEnum.walletconnectv2)) {
await cancelWalletConnectAction();
return;
}

const typedProvider = provider as unknown as {
cancelAction: () => Promise<boolean> | boolean;
dispose: () => Promise<void> | void;
};

try {
if (
'cancelAction' in typedProvider &&
typeof typedProvider.cancelAction === 'function'
) {
await typedProvider.cancelAction();
}

if (
'dispose' in typedProvider &&
typeof typedProvider.dispose === 'function'
) {
await typedProvider.dispose();
}
} catch (error) {
console.info('Failed to cancel action and/or dispose provider: ', {
provider,
error
});
}
};
}
20 changes: 0 additions & 20 deletions src/hooks/transactions/useCancelCrossWindowAction.ts

This file was deleted.

Loading