diff --git a/src/components/Location.vue b/src/components/Location.vue
index e7ac2aa8..43dc507d 100644
--- a/src/components/Location.vue
+++ b/src/components/Location.vue
@@ -10,18 +10,16 @@ import { updateCurrentTabProxyBadge } from '@/helpers/proxyBadge';
import useListProxies from '@/composables/useListProxies';
import useSocksProxy from '@/composables/useSocksProxy';
import useLocations from '@/composables/useLocations';
-import useActiveTab from '@/composables/useActiveTab';
import useProxyHistory from '@/composables/useProxyHistory/useProxyHistory';
import type { HistoryEntry } from '@/composables/useProxyHistory/HistoryEntries.types';
-const { activeTabHost } = useActiveTab();
-const { customProxy, hostProxySelect, toggleLocations } = useLocations();
+const { customProxyHost, customProxySelect, toggleLocations } = useLocations();
const { proxiesList } = useListProxies();
const { setCurrentHostProxy, setGlobalProxy } = useSocksProxy();
const { storeSocksProxyUsage } = useProxyHistory();
const currentOrAllWebsites = computed(() =>
- hostProxySelect.value ? customProxy.value || activeTabHost.value : 'all your browser traffic',
+ customProxySelect.value ? customProxyHost.value : 'all your browser traffic',
);
const setProxy = (
@@ -35,12 +33,12 @@ const setProxy = (
storeSocksProxyUsage({ country, countryCode, city, hostname, ipv4_address });
toggleLocations();
- if (hostProxySelect.value) {
+ if (customProxySelect.value) {
setCurrentHostProxy(
{ country, countryCode, city, hostname, ipv4_address, port },
- customProxy.value || activeTabHost.value,
+ customProxyHost.value,
);
- customProxy.value = '';
+ customProxyHost.value = '';
} else {
setGlobalProxy({ country, countryCode, city, hostname, ipv4_address, port });
}
diff --git a/src/components/Proxy/CustomProxies.vue b/src/components/Proxy/CustomProxies.vue
index 8c2ffedf..11fcb05f 100644
--- a/src/components/Proxy/CustomProxies.vue
+++ b/src/components/Proxy/CustomProxies.vue
@@ -10,18 +10,22 @@ import TitleCategory from '@/components/TitleCategory.vue';
import useSocksProxy from '@/composables/useSocksProxy';
import useLocations from '@/composables/useLocations';
-const { customProxy, hostProxySelect, toggleLocations } = useLocations();
+const { proxySelect } = useLocations();
// For some reason importing `hostProxiesDetails` directly from useStore()
// will cause the value not to be reactively updated
const {
allowProxy,
excludedHosts,
+ globalProxyDetails,
+ globalProxyEnabled,
hostProxiesDetails,
neverProxyHost,
removeCustomProxy,
+ removeGlobalProxy,
toggleCustomProxy,
toggleCustomProxyDNS,
+ toggleGlobalProxy,
} = useSocksProxy();
const manualProxyDomain = ref('');
@@ -32,10 +36,8 @@ const combinedHosts = computed(() => {
return [...new Set(allHosts)].sort((a, b) => a.localeCompare(b));
});
-const handleCustomProxySelect = (host: string) => {
- customProxy.value = host;
- hostProxySelect.value = true;
- toggleLocations();
+const handleProxySelect = (host?: string) => {
+ proxySelect(host);
manualProxyDomain.value = '';
};
@@ -51,7 +53,7 @@ const neverProxyHostManual = () => {
const handleCustomProxySelectManual = () => {
if (manualProxyDomain.value) {
- handleCustomProxySelect(manualProxyDomain.value);
+ handleProxySelect(manualProxyDomain.value);
manualProxyDomain.value = '';
manualProxyDomainError.value = false;
} else {
@@ -90,6 +92,44 @@ const clearError = () => {
Please enter a domain name
+