From 0d3a461662205ae49007869abd020a1f929d1f23 Mon Sep 17 00:00:00 2001 From: Michael Chappell <7581002+mchappell@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:43:31 +0100 Subject: [PATCH] fix(extension): shared wallet creation uses currently selected environment --- .../browser-view/features/shared-wallet/SharedWallet.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/browser-extension-wallet/src/views/browser-view/features/shared-wallet/SharedWallet.tsx b/apps/browser-extension-wallet/src/views/browser-view/features/shared-wallet/SharedWallet.tsx index 508dfe346..42feb81b3 100644 --- a/apps/browser-extension-wallet/src/views/browser-view/features/shared-wallet/SharedWallet.tsx +++ b/apps/browser-extension-wallet/src/views/browser-view/features/shared-wallet/SharedWallet.tsx @@ -16,14 +16,10 @@ import { walletRoutePaths } from '@routes'; import { useWalletManager } from '@hooks'; import { useWalletStore } from '@stores'; import { WalletType } from '@cardano-sdk/web-extension'; -import { config } from '@src/config'; import { Wallet } from '@lace/cardano'; import { useAnalyticsContext } from '@providers'; import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker'; -const { CHAIN } = config(); -const DEFAULT_CHAIN_ID = Wallet.Cardano.ChainIds[CHAIN]; - type CreateWalletParams = { coSigners: CoSigner[]; name: string; @@ -35,7 +31,7 @@ export const SharedWallet = (): JSX.Element => { const history = useHistory(); const { walletRepository, generateSharedWalletKey, saveSharedWalletKey, createInMemorySharedWallet } = useWalletManager(); - const { walletInfo, cardanoWallet } = useWalletStore(); + const { walletInfo, cardanoWallet, environmentName } = useWalletStore(); const { page, setBackgroundPage } = useBackgroundPage(); const [sharedWalletKey, setSharedWalletKey] = useState(); @@ -60,7 +56,7 @@ export const SharedWallet = (): JSX.Element => { await createInMemorySharedWallet({ name: data.name, - chainId: DEFAULT_CHAIN_ID, + chainId: Wallet.Cardano.ChainIds[environmentName], ownSignerWalletId: activeWalletId, quorumRules: data.quorumRules, coSigners: data.coSigners,