Skip to content

Commit

Permalink
Fix default active proxy tab in Popup
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihildt committed Dec 11, 2024
1 parent 307fa50 commit a94e4c4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/Proxy/HomeProxyStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,21 @@ const subDomainProxyEnabled = computed(() => {
const lastClickedTab = ref<string | null>(null);
const defaultActiveTab = computed(() => {
if (tabDomain.value.hasSubdomain && hasSubDomainProxy.value && subDomainProxyEnabled.value) {
// Check subdomain first (active proxy or excluded)
if (
tabDomain.value.hasSubdomain &&
(subDomainProxyEnabled.value || excludedHosts.value.includes(tabDomain.value.subDomain))
) {
return 'current-sub-domain';
}
if (domainProxyDetails.value?.socksEnabled || currentHostExcluded.value) {
// Check domain (active proxy or excluded)
if (
domainProxyDetails.value?.socksEnabled ||
excludedHosts.value.includes(tabDomain.value.domain)
) {
return 'current-domain';
}
// Default to all websites
return 'all-websites';
});
Expand Down Expand Up @@ -116,7 +125,7 @@ const handleRemoveProxy = (host: string) => {
lastClickedTab.value = defaultActiveTab.value;
};
watch([currentHostProxyEnabled, subDomainProxyEnabled, domainProxyDetails], () => {
watch([currentHostProxyEnabled, subDomainProxyEnabled, domainProxyDetails, excludedHosts], () => {
lastClickedTab.value = null;
});
</script>
Expand Down

0 comments on commit a94e4c4

Please sign in to comment.