diff --git a/src/components/Proxy/HomeProxyStatus.vue b/src/components/Proxy/HomeProxyStatus.vue index ed20c219..256b8808 100644 --- a/src/components/Proxy/HomeProxyStatus.vue +++ b/src/components/Proxy/HomeProxyStatus.vue @@ -8,14 +8,17 @@ import IconLabel from '@/components/IconLabel.vue'; import TitleCategory from '@/components/TitleCategory.vue'; import useActiveTab from '@/composables/useActiveTab'; -import { ConnectionKey, defaultConnection } from '@/composables/useConnection'; -import useSocksProxies from '@/composables/useSocksProxies/useSocksProxies'; +import useConnection, { ConnectionKey, defaultConnection } from '@/composables/useConnection'; import useLocations from '@/composables/useLocations'; import useProxyPermissions from '@/composables/useProxyPermissions'; +import useSocksProxies from '@/composables/useSocksProxies/useSocksProxies'; import useSocksProxy from '@/composables/useSocksProxy'; const { activeTabHost, isBrowserPage } = useActiveTab(); +const { updateConnection } = useConnection(); +const { proxySelect } = useLocations(); const { proxyPermissionsGranted, triggerRequestProxyPermissions } = useProxyPermissions(); +const { getSocksProxies } = useSocksProxies(); const { allowProxy, currentHostProxyDetails, @@ -29,8 +32,6 @@ const { toggleCurrentHostProxy, toggleGlobalProxy, } = useSocksProxy(); -const { getSocksProxies } = useSocksProxies(); -const { proxySelect } = useLocations(); const { connection } = inject(ConnectionKey, defaultConnection); const currentHostExcluded = computed(() => excludedHosts.value.includes(activeTabHost.value)); @@ -56,6 +57,16 @@ const handleProxySelect = async (host?: string) => { proxySelect(host); await getSocksProxies(); }; + +const handleRemoveGlobalProxy = () => { + removeGlobalProxy(); + updateConnection(); +}; + +const handleToggleGlobalProxy = () => { + toggleGlobalProxy(); + updateConnection(); +};