Skip to content

Commit

Permalink
Add default message when no proxy configured in the options page
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihildt committed Oct 17, 2024
1 parent b787777 commit c7c877c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
17 changes: 1 addition & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/components/Proxy/CustomProxies.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import TitleCategory from '@/components/TitleCategory.vue';
import useSocksProxy from '@/composables/useSocksProxy';
import useLocations from '@/composables/useLocations';
import { openPopup } from '@/helpers/browserExtension';
const { customProxy, hostProxySelect, toggleLocations } = useLocations();
// For some reason importing `hostProxiesDetails` directly from useStore()
Expand All @@ -33,6 +35,13 @@ const handleCustomProxySelect = (host: string) => {
</script>

<template>
<NCard v-if="excludedHosts.length <= 0 && proxies.length <= 0" :bordered="false">
<p>
No custom proxies configured. You can configure the proxy through
<a class="underline cursor-pointer" @click="openPopup">the popup</a>.
</p>
</NCard>

<NCard v-if="proxies.length > 0" :bordered="false" class="mb-4">
<TitleCategory title="Custom proxies" />
<div v-for="{ host, proxyDetails } in proxies" :key="host" :bordered="false" class="mb-4">
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/browserExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ export const openOptions = async (tab?: Tab) => {
browser.runtime.openOptionsPage();
};

export const openPopup = () => {
browser.browserAction.openPopup();
};

export const { version } = browser.runtime.getManifest();

0 comments on commit c7c877c

Please sign in to comment.