Skip to content

Commit

Permalink
Explicitly tell when Mullvad Encrypted DNS is in use
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihildt committed Apr 24, 2024
1 parent 882673f commit 09f883b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
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

0 comments on commit 09f883b

Please sign in to comment.