diff --git a/src/composables/useSocksProxy.ts b/src/composables/useSocksProxy.ts index b0f26561..de9550c8 100644 --- a/src/composables/useSocksProxy.ts +++ b/src/composables/useSocksProxy.ts @@ -6,6 +6,7 @@ import { ProxyInfoType, ProxyOperationArgs, } from '@/helpers/socksProxy.types'; +import { updateTabsProxyBadges } from '@/helpers/browserAction'; import useActiveTab from '@/composables/useActiveTab'; import useConnection from '@/composables/useConnection'; @@ -36,9 +37,11 @@ const currentHostProxyDNSEnabled = computed(() => currentHostProxyDetails.value? const toggleGlobalProxy = () => { globalProxyDetails.value.socksEnabled = !globalProxyDetails.value.socksEnabled; + updateTabsProxyBadges(); }; const toggleCurrentHostProxy = () => { hostProxiesDetails.value[activeTabHost.value].socksEnabled = !currentHostProxyEnabled.value; + updateTabsProxyBadges(); }; const toggleGlobalProxyDNS = () => { diff --git a/src/helpers/browserAction.ts b/src/helpers/browserAction.ts index ec26285e..3a120bba 100644 --- a/src/helpers/browserAction.ts +++ b/src/helpers/browserAction.ts @@ -33,7 +33,7 @@ const updateTabProxyBadge = async (tab: browser.tabs.Tab, activeProxyDetails: Pr }; // Update state of the proxy badge & title, for all tabs -const updateTabsProxyBadges = async () => { +export const updateTabsProxyBadges = async () => { const tabs = await browser.tabs.query({}); const activeProxyDetails = await getActiveProxyDetails();