Skip to content

Commit

Permalink
fix(extension): [LW-11766] shared wallet creation uses currently sele…
Browse files Browse the repository at this point in the history
…cted environment (#1483)
  • Loading branch information
mchappell committed Oct 25, 2024
1 parent e653576 commit 1f39fd6
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Wallet.Crypto.Bip32PublicKeyHex>();
Expand All @@ -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,
Expand Down

0 comments on commit 1f39fd6

Please sign in to comment.