fixed network selection (hex string) and icons

This commit is contained in:
hueso
2025-10-11 21:31:53 -03:00
parent a906fa136d
commit 358ae7410f
5 changed files with 12 additions and 10 deletions

View File

@@ -80,9 +80,10 @@ const closeMenu = (): void => {
const networkChange = async (network: NetworkConfig): Promise<void> => {
currencyMenuOpenToggle.value = false;
const chainId = network.id.toString(16)
try {
await setChain({
chainId: String(network.id),
chainId: `0x${chainId}`,
wallet: connectedWallet.value?.label || "",
});
user.setNetwork(network);

View File

@@ -23,11 +23,12 @@ const checkNetwork = () => {
const switchNetwork = async () => {
try {
if (connectedWallet.value && connectedWallet.value.provider) {
let chainId = network.value.id.toString(16);
await connectedWallet.value.provider.request({
method: "wallet_switchEthereumChain",
params: [
{
chainId: network.value.id,
chainId: `0x${chainId}`,
},
],
});