Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly tell when Mullvad Encrypted DNS is in use #220

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/components/ConnectionDetails/AdvancedDns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import IconLabel from '@/components/IconLabel.vue';
import MuSpinner from '@/components/Icons/MuSpinner.vue';

import useCheckDnsLeaks from '@/composables/useCheckDnsLeaks';
import { ConnectionKey, defaultConnection } from '@/composables/useConnection';
import { inject } from 'vue';

const { dnsServers, isLoading, isError } = useCheckDnsLeaks();
const { connection } = inject(ConnectionKey, defaultConnection);
</script>

<template>
Expand All @@ -24,7 +21,7 @@ const { connection } = inject(ConnectionKey, defaultConnection);
<div v-else>
<div v-for="dnsServer in dnsServers" :key="dnsServer.ip">
<IconLabel
v-if="connection.isMullvad"
v-if="dnsServer.mullvad_dns"
:text="`${dnsServer.ip} (${
dnsServer.mullvad_dns_hostname ||
dnsServer.hostname ||
Expand Down
6 changes: 2 additions & 4 deletions src/components/ConnectionDetails/ConnectionDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ const { isLoading, isError, connection } = inject(ConnectionKey, defaultConnecti
<h4 class="font-semibold">Provider</h4>
<div class="ml-2">{{ connection.provider }}</div>
</div>
<div class="flex">
<h4 class="font-semibold">DNS Server(s)</h4>
<AdvancedDns class="ml-2" />
</div>
<DnsLeakStatus class="text-lg mt-2" />
<AdvancedDns class="ml-8" />
</div>
</div>
</div>
Expand Down
22 changes: 18 additions & 4 deletions src/components/ConnectionStatus/DnsLeakStatus.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
<script lang="ts" setup>
import { computed } from 'vue';
import { computed, inject } from 'vue';

import IconLabel from '@/components/IconLabel.vue';

import useCheckDnsLeaks from '@/composables/useCheckDnsLeaks';
import { ConnectionKey, defaultConnection } from '@/composables/useConnection';

const { isLeaking, isLoading, isError } = useCheckDnsLeaks();
const labelText = computed(() => (isLeaking.value ? 'Leaking DNS servers' : 'No DNS Leaks'));
const iconType = computed(() => (isLeaking.value ? 'leak' : 'success'));
const { isLeaking, isLoading, isError, isMullvadDoh } = useCheckDnsLeaks();
const { connection } = inject(ConnectionKey, defaultConnection);

const labelText = computed(() => {
if (isLeaking.value) {
return connection.value.isMullvad ? 'Leaking DNS servers' : 'Not using Mullvad Encrypted DNS';
}
return isMullvadDoh.value ? 'Using Mullvad Encrypted DNS' : 'Using Mullvad DNS';
});

const iconType = computed(() => {
if (isLeaking.value) {
return connection.value.isMullvad ? 'leak' : 'warning';
}
return 'success';
});
</script>

<template>
Expand Down
Loading