Skip to content

Commit

Permalink
fix: unable to change the network to testnet on the latest (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
teebszet committed Nov 1, 2023
1 parent d0613f2 commit 9439099
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@ledgerhq/hw-transport-webusb": "^6.27.13",
"@phosphor-icons/react": "^2.0.10",
"@react-spring/web": "^9.6.1",
"@secretkeylabs/xverse-core": "2.2.0",
"@secretkeylabs/xverse-core": "2.3.0",
"@stacks/connect": "^6.10.2",
"@stacks/encryption": "4.3.5",
"@stacks/stacks-blockchain-api-types": "6.1.1",
Expand Down
9 changes: 3 additions & 6 deletions src/app/hooks/useWalletReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import useStxWalletData from '@hooks/queries/useStxWalletData';
import useNetworkSelector from '@hooks/useNetwork';
import { createWalletAccount, restoreWalletWithAccounts } from '@secretkeylabs/xverse-core/account';
import { getBnsName } from '@secretkeylabs/xverse-core/api/stacks';
import { decryptSeedPhraseCBC } from '@secretkeylabs/xverse-core/encryption';
import {
Account,
AnalyticsEvents,
SettingsNetwork,
StacksNetwork,
} from '@secretkeylabs/xverse-core/types';
import { newWallet, walletFromSeedPhrase } from '@secretkeylabs/xverse-core/wallet';
import { decryptSeedPhraseCBC } from '@secretkeylabs/xverse-core/encryption';
import {
ChangeNetworkAction,
addAccountAction,
ChangeNetworkAction,
fetchAccountAction,
getActiveAccountsAction,
resetWalletAction,
Expand All @@ -29,9 +29,9 @@ import { generatePasswordHash } from '@utils/encryptionUtils';
import { isHardwareAccount, isLedgerAccount } from '@utils/helper';
import { resetMixPanel, trackMixPanel } from '@utils/mixpanel';
import { useDispatch } from 'react-redux';
import useSeedVault from './useSeedVault';
import useWalletSelector from './useWalletSelector';
import useWalletSession from './useWalletSession';
import useSeedVault from './useSeedVault';

const useWalletReducer = () => {
const {
Expand Down Expand Up @@ -170,7 +170,6 @@ const useWalletReducer = () => {
ordinalsPublicKey: wallet.ordinalsPublicKey,
stxAddress: wallet.stxAddress,
stxPublicKey: wallet.stxPublicKey,
bnsName: wallet.bnsName,
};
const hasSeed = await seedVault.hasSeed();
if (hasSeed && !masterPubKey) {
Expand Down Expand Up @@ -230,7 +229,6 @@ const useWalletReducer = () => {
ordinalsPublicKey: wallet.ordinalsPublicKey,
stxAddress: wallet.stxAddress,
stxPublicKey: wallet.stxPublicKey,
bnsName: wallet.bnsName,
};
trackMixPanel(AnalyticsEvents.CreateNewWallet);

Expand Down Expand Up @@ -297,7 +295,6 @@ const useWalletReducer = () => {
ordinalsPublicKey: wallet.ordinalsPublicKey,
stxAddress: wallet.stxAddress,
stxPublicKey: wallet.stxPublicKey,
bnsName: wallet.bnsName,
};
dispatch(setWalletAction(wallet));
try {
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/settings/changeNetwork/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BottomBar from '@components/tabBar';
import TopRow from '@components/topRow';
import useWalletReducer from '@hooks/useWalletReducer';
import useWalletSelector from '@hooks/useWalletSelector';
import type { SettingsNetwork, StacksMainnet, StacksTestnet } from '@secretkeylabs/xverse-core';
import { SettingsNetwork, StacksMainnet, StacksTestnet } from '@secretkeylabs/xverse-core';
import { initialNetworksList } from '@utils/constants';
import { isValidBtcApi, isValidStacksApi } from '@utils/helper';
import { useState } from 'react';
Expand Down

0 comments on commit 9439099

Please sign in to comment.