Skip to content

Commit

Permalink
fix: active wallet chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jan 11, 2024
1 parent 5def7e5 commit 9fce527
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/web3/store/walletSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export type IWalletSlice = {

isActiveWalletAccountChanging: boolean;
changeActiveWalletAccount: (account?: GetAccountReturnType) => Promise<void>;
// isActiveWalletChainChanging: boolean;
// changeActiveWalletChain: (chain?: Chain) => Promise<void>;

impersonated?: {
account?: Account;
Expand Down Expand Up @@ -194,11 +192,14 @@ export function createWalletSlice({
}

const account = getAccount(config);

console.log('account in connect wallet', account);

if (account?.isConnected && account?.address) {
await get().setActiveWallet({
walletType,
address: account.address,
chain: account.chain,
chain: account.chain || getChainByChainId(chainId || 1),
isActive: account.isConnected,
isContractAddress: false,
});
Expand Down Expand Up @@ -294,27 +295,6 @@ export function createWalletSlice({
set({ isActiveWalletAccountChanging: false });
}
},
// isActiveWalletChainChanging: false,
// changeActiveWalletChain: async (chain) => {
// const activeWallet = get().activeWallet;
// if (
// !!chain &&
// activeWallet &&
// activeWallet.isActive &&
// activeWallet?.chain?.id !== chain.id &&
// !get().isActiveWalletChainChanging
// ) {
// set({ isActiveWalletChainChanging: true });
// await get().setActiveWallet({
// walletType: activeWallet.walletType,
// address: activeWallet.address,
// isActive: activeWallet.isActive,
// isContractAddress: activeWallet.isContractAddress,
// chain: chain,
// });
// set({ isActiveWalletChainChanging: false });
// }
// },

setImpersonated: (privateKeyOrAddress) => {
if (isAddress(privateKeyOrAddress)) {
Expand Down

0 comments on commit 9fce527

Please sign in to comment.