Skip to content

Commit

Permalink
Merge branch 'develop' into tmp/20240816
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv committed Aug 15, 2024
2 parents 0ad6bf2 + c942846 commit 2cf64c1
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Account } from '@/background/service/preference';
import { KEYRINGS_LOGOS, WALLET_BRAND_CONTENT } from '@/constant';
import {
KEYRINGS_LOGOS,
WALLET_BRAND_CONTENT,
WALLET_BRAND_TYPES,
} from '@/constant';
import { SessionSignal } from '@/ui/component/WalletConnect/SessionSignal';
import { useDisplayBrandName } from '@/ui/component/WalletConnect/useDisplayBrandName';
import { useSessionChainId } from '@/ui/component/WalletConnect/useSessionChainId';
Expand Down Expand Up @@ -71,10 +75,15 @@ export const WalletConnectAccount: React.FC<Props> = ({ account, chain }) => {

const wallet = useWallet();
React.useEffect(() => {
if (chain && sessionChainId && chain.id !== sessionChainId) {
if (
brandName === WALLET_BRAND_TYPES.METAMASK &&
chain &&
sessionChainId &&
chain.id !== sessionChainId
) {
wallet.walletConnectSwitchChain(account, chain.id);
}
}, [sessionChainId, chain]);
}, [sessionChainId, chain, brandName]);

const TipContent = () => {
switch (tipStatus) {
Expand Down

0 comments on commit 2cf64c1

Please sign in to comment.