-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling when proxy is set and no connection is detected
- Loading branch information
Showing
4 changed files
with
49 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,15 @@ | ||
<script lang="ts" setup> | ||
import { computed, inject } from 'vue'; | ||
import { NTag } from 'naive-ui'; | ||
import FeInfo from '@/components/Icons/FeInfo.vue'; | ||
import IconLabel from '@/components/IconLabel.vue'; | ||
import LocationDrawer from '@/components/ConnectionDetails/LocationDrawer.vue'; | ||
import ProxyGlobal from '@/components/ProxyStatus/ProxyGlobal.vue'; | ||
import ProxyHost from '@/components/ProxyStatus/ProxyHost.vue'; | ||
import useActiveTab from '@/composables/useActiveTab'; | ||
import { ConnectionKey, defaultConnection } from '@/composables/useConnection'; | ||
const { isAboutPage } = useActiveTab(); | ||
const { connection, isError, isLoading } = inject(ConnectionKey, defaultConnection); | ||
// Only allow connecting to Proxy if the user is connected to Mullvad | ||
const canUseProxy = computed(() => connection.value.isMullvad); | ||
</script> | ||
|
||
<template> | ||
<div v-if="isLoading"> | ||
<p class="text-xl mb-2"> | ||
<IconLabel text="Checking connection" type="spinner" /> | ||
</p> | ||
</div> | ||
|
||
<div v-else-if="canUseProxy || isError"> | ||
<ProxyHost v-if="!isAboutPage" /> | ||
<ProxyGlobal /> | ||
<LocationDrawer /> | ||
</div> | ||
|
||
<n-tag v-else round :bordered="false" type="info"> | ||
To use the proxy, <em>connect to Mullvad VPN first.</em> | ||
<template #icon> | ||
<FeInfo /> | ||
</template> | ||
</n-tag> | ||
<ProxyHost v-if="!isAboutPage" /> | ||
<ProxyGlobal /> | ||
<LocationDrawer /> | ||
</template> |