Skip to content

Commit

Permalink
Fix proxy location selection error
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihildt committed Feb 15, 2024
1 parent a65564f commit 972facd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/components/Proxy/ProxyGlobal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { computed } from 'vue';
import { NCard, NSwitch, NTooltip } from 'naive-ui';
import CurrentProxyDetails from '@/components/Proxy/CurrentProxyDetails.vue';
import ProxyGlobalButton from '@/components/Proxy/ProxyGlobalButton.vue';
import Button from '@/components/Buttons/Button.vue';
import TitleCategory from '@/components/TitleCategory.vue';
import useSocksProxy from '@/composables/useSocksProxy';
import useLocations from '@/composables/useLocations';
const { globalProxyDetails, globalProxyEnabled, toggleGlobalProxy } = useSocksProxy();
const { hostProxySelect } = useLocations();
const { hostProxySelect, toggleLocations } = useLocations();
const status = computed(() => (globalProxyEnabled.value ? 'Enabled' : 'Disabled'));
const handleSetGlobalProxy = () => {
const handleProxySelect = () => {
hostProxySelect.value = false;
toggleGlobalProxy();
toggleLocations();
};
</script>

Expand All @@ -26,13 +26,13 @@ const handleSetGlobalProxy = () => {
<TitleCategory title="Proxy for all websites" />
<n-tooltip v-if="globalProxyDetails.server">
<template #trigger>
<n-switch :value="globalProxyEnabled" @update-value="handleSetGlobalProxy" />
<n-switch :value="globalProxyEnabled" @update-value="toggleGlobalProxy()" />
</template>
<span> {{ status }}</span>
</n-tooltip>
</div>

<CurrentProxyDetails v-if="globalProxyDetails.server" :proxy-details="globalProxyDetails" />
<ProxyGlobalButton> Select location </ProxyGlobalButton>
<Button @click="handleProxySelect"> Select location </Button>
</n-card>
</template>
10 changes: 0 additions & 10 deletions src/components/Proxy/ProxyGlobalButton.vue

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/Proxy/ProxyHost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const allowProxy = () => {
excludedHosts.value = excludedHosts.value.filter((excluded) => excluded !== activeTabHost.value);
};
const handleHostProxySelect = () => {
const handleProxySelect = () => {
hostProxySelect.value = true;
toggleLocations();
};
Expand Down Expand Up @@ -63,7 +63,7 @@ const handleHostProxySelect = () => {
</Button>

<n-button-group v-else>
<Button class="flex items-center justify-center" @click="handleHostProxySelect">
<Button class="flex items-center justify-center" @click="handleProxySelect">
Select location
</Button>

Expand Down

0 comments on commit 972facd

Please sign in to comment.