From 4bea895d96783edd86c871b3c94be34f80f4f603 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Wed, 20 Mar 2024 11:07:10 +0100 Subject: [PATCH] Do not show a toast after dismissing the dns dialog --- .../mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt index b954aff5cff5..2f02cdedc3dc 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt @@ -120,15 +120,15 @@ class VpnSettingsViewModel( fun onDnsDialogDismissed() { if (vmState.value.customDnsList.isEmpty()) { - onToggleCustomDns(false) + onToggleCustomDns(enable = false, showToast = false) } } - fun onToggleCustomDns(enable: Boolean) { + fun onToggleCustomDns(enable: Boolean, showToast: Boolean = true) { repository.setDnsState(if (enable) DnsState.Custom else DnsState.Default) if (enable && vmState.value.customDnsList.isEmpty()) { viewModelScope.launch { _uiSideEffect.send(VpnSettingsSideEffect.NavigateToDnsDialog) } - } else { + } else if (showToast) { showApplySettingChangesWarningToast() } }