diff --git a/packages/extension/src/ui/action/App.vue b/packages/extension/src/ui/action/App.vue
index 1d1e62129..cc0563845 100644
--- a/packages/extension/src/ui/action/App.vue
+++ b/packages/extension/src/ui/action/App.vue
@@ -83,8 +83,8 @@
v-if="addNetworkShow"
@close:popup="addNetworkShow = !addNetworkShow"
@update:pin-network="setIsPinnedNetwork"
+ @update:testNetworkToggle="setIsToggledTestNetwork"
/>
-
{
await networksState.setNetworkStatus(network, isPinned);
await setActiveNetworks();
};
+
+const setIsToggledTestNetwork = async () => {
+ await setActiveNetworks();
+};
diff --git a/packages/extension/src/ui/action/icons/actions/pin.vue b/packages/extension/src/ui/action/icons/actions/pin.vue
index d84887096..11232844d 100644
--- a/packages/extension/src/ui/action/icons/actions/pin.vue
+++ b/packages/extension/src/ui/action/icons/actions/pin.vue
@@ -1,7 +1,7 @@
+
@@ -23,6 +24,7 @@ const isNetworkList = ref(true);
const emit = defineEmits<{
(e: 'close:popup'): void;
(e: 'update:pinNetwork', network: string, isPinned: boolean): void;
+ (e: 'update:testNetworkToggle'): void;
}>();
const setPinnedNetwork = (network: string, isPinned: boolean) => {
diff --git a/packages/extension/src/ui/action/views/add-network/views/add-network-list.vue b/packages/extension/src/ui/action/views/add-network/views/add-network-list.vue
index 61508b73a..b68e37841 100644
--- a/packages/extension/src/ui/action/views/add-network/views/add-network-list.vue
+++ b/packages/extension/src/ui/action/views/add-network/views/add-network-list.vue
@@ -75,6 +75,7 @@ import { NetworkNames } from '@enkryptcom/types';
const emit = defineEmits<{
(e: 'update:pinNetwork', network: string, isPinned: boolean): void;
+ (e: 'update:testNetworkToggle'): void;
}>();
const networksState = new NetworksState();
@@ -157,9 +158,16 @@ const onTogglePin = async (networkName: string, isActive: boolean) => {
}
};
-const onTestnetToggle = async (networkName: string, isActive: boolean) => {
+const onTestnetToggle = async (
+ networkName: NetworkNames,
+ isActive: boolean,
+) => {
await networksState.setTestnetStatus(networkName, isActive);
await setNetworkLists();
+ if (!isActive && getIsPinned(networkName)) {
+ onTogglePin(networkName, false);
+ }
+ emit('update:testNetworkToggle');
};
const onNetworkDeleted = async (chainId: string) => {