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() } }