diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 1b1502a29..3fb9da203 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -9,8 +9,8 @@ on: types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] jobs: - # Enforces the update of a changelog file on every pull request + # Enforces the update of a changelog file on every pull request changelog: runs-on: ubuntu-latest steps: - - uses: dangoslen/changelog-enforcer@v3 \ No newline at end of file + - uses: dangoslen/changelog-enforcer@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6678ef874..ddcb2d41f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,15 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [[v2.40.9]](https://github.com/multiversx/mx-sdk-dapp/pull/1273)] - 2024-09-25 +- [Fixed multisig login](https://github.com/multiversx/mx-sdk-dapp/pull/1272) + ## [[v2.40.8]](https://github.com/multiversx/mx-sdk-dapp/pull/1270)] - 2024-09-24 - [Update passkey provider to use "auto" strategy when creating a new passkey](https://github.com/multiversx/mx-sdk-dapp/pull/1270) - - [Added cross-window 2FA wallet guardian signing](https://github.com/multiversx/mx-sdk-dapp/pull/1271) ## [[v2.40.7]](https://github.com/multiversx/mx-sdk-dapp/pull/1267)] - 2024-09-23 - [Remove hardcoded "erd" check when validating an address](https://github.com/multiversx/mx-sdk-dapp/pull/1267) - ## [[v2.40.6]](https://github.com/multiversx/mx-sdk-dapp/pull/1266)] - 2024-09-20 - [Update passkey provider in order to fix passkey login](https://github.com/multiversx/mx-sdk-dapp/pull/1266) diff --git a/package.json b/package.json index 2c1bf4afe..ce4158ab2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-dapp", - "version": "2.40.8", + "version": "2.40.9", "description": "A library to hold the main logic for a dapp on the MultiversX blockchain", "author": "MultiversX", "license": "GPL-3.0-or-later", diff --git a/src/components/ProviderInitializer/ProviderInitializer.tsx b/src/components/ProviderInitializer/ProviderInitializer.tsx index 0dbf7f7b2..0844237e1 100644 --- a/src/components/ProviderInitializer/ProviderInitializer.tsx +++ b/src/components/ProviderInitializer/ProviderInitializer.tsx @@ -49,6 +49,7 @@ import { } from 'utils/account'; import { parseNavigationParams } from 'utils/parseNavigationParams'; +import { isContract } from 'utils/smartContracts'; import { getOperaProvider, getCrossWindowProvider, @@ -150,10 +151,17 @@ export function ProviderInitializer() { async function checkAddress() { const { - remainingParams: { impersonate } + remainingParams: { impersonate, multisig } } = parseNavigationParams(['impersonate']); - if (!tokenLogin?.nativeAuthToken || impersonate) { + const addressIsContract = isContract(address); + + if ( + !tokenLogin?.nativeAuthToken || + impersonate || + multisig || + addressIsContract + ) { return; } diff --git a/src/hooks/account/useGetLoginInfo.ts b/src/hooks/account/useGetLoginInfo.ts index 96f8799db..3fcaf01b7 100644 --- a/src/hooks/account/useGetLoginInfo.ts +++ b/src/hooks/account/useGetLoginInfo.ts @@ -6,8 +6,9 @@ export const useGetLoginInfo = () => { // if AxiosInterceptor is mounted, prioritize information comming from AxiosContext try { const { loginInfo, isLoggedIn } = useAxiosInterceptorContext(); + return { ...loginInfo, isLoggedIn }; - // if not mounted, proceed to returning informaiton from store + // if not mounted, proceed to returning information from store } catch { const loginInfo = useSelector(loginInfoSelector); const isLoggedIn = useSelector(isLoggedInSelector); diff --git a/src/hooks/login/useCrossWindowLogin.ts b/src/hooks/login/useCrossWindowLogin.ts index 1874e712c..fa991f6a7 100644 --- a/src/hooks/login/useCrossWindowLogin.ts +++ b/src/hooks/login/useCrossWindowLogin.ts @@ -7,7 +7,7 @@ import { setAccountProvider } from 'providers/accountProvider'; import { loginAction } from 'reduxStore/commonActions'; import { useDispatch, useSelector } from 'reduxStore/DappProviderContext'; import { networkSelector } from 'reduxStore/selectors/networkConfigSelectors'; -import { setAccount } from 'reduxStore/slices'; +import { setAccount, setAddress } from 'reduxStore/slices'; import { InitiateLoginFunctionType, LoginHookGenericStateType, @@ -132,6 +132,8 @@ export const useCrossWindowLogin = ({ }) ); + dispatch(setAddress(account.address)); + dispatch( setAccount({ ...account, diff --git a/src/reduxStore/slices/accountInfoSlice.ts b/src/reduxStore/slices/accountInfoSlice.ts index 580bea53a..41dad1af1 100644 --- a/src/reduxStore/slices/accountInfoSlice.ts +++ b/src/reduxStore/slices/accountInfoSlice.ts @@ -84,9 +84,11 @@ export const accountInfoSlice = createSlice({ ) => { // account fetching always comes after address is populated const isSameAddress = state.address === action.payload.address; + state.accounts = { [state.address]: isSameAddress ? action.payload : emptyAccount }; + state.shard = action.payload.shard; state.isAccountLoading = false; state.accountLoadingError = null;