Skip to content

Commit 8b90c28

Browse files
committed
Refresh the extension badge when toggling proxy
1 parent 9089b8d commit 8b90c28

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/composables/useSocksProxy.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ProxyInfoType,
77
ProxyOperationArgs,
88
} from '@/helpers/socksProxy.types';
9+
import { updateTabsProxyBadges } from '@/helpers/browserAction';
910

1011
import useActiveTab from '@/composables/useActiveTab';
1112
import useConnection from '@/composables/useConnection';
@@ -36,9 +37,11 @@ const currentHostProxyDNSEnabled = computed(() => currentHostProxyDetails.value?
3637

3738
const toggleGlobalProxy = () => {
3839
globalProxyDetails.value.socksEnabled = !globalProxyDetails.value.socksEnabled;
40+
updateTabsProxyBadges();
3941
};
4042
const toggleCurrentHostProxy = () => {
4143
hostProxiesDetails.value[activeTabHost.value].socksEnabled = !currentHostProxyEnabled.value;
44+
updateTabsProxyBadges();
4245
};
4346

4447
const toggleGlobalProxyDNS = () => {

src/helpers/browserAction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const updateTabProxyBadge = async (tab: browser.tabs.Tab, activeProxyDetails: Pr
3333
};
3434

3535
// Update state of the proxy badge & title, for all tabs
36-
const updateTabsProxyBadges = async () => {
36+
export const updateTabsProxyBadges = async () => {
3737
const tabs = await browser.tabs.query({});
3838
const activeProxyDetails = await getActiveProxyDetails();
3939

0 commit comments

Comments
 (0)