Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not show a toast after dismissing the dns dialog
Browse files Browse the repository at this point in the history
Pururun committed Mar 20, 2024
1 parent 625a787 commit 4bea895
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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()
}
}

0 comments on commit 4bea895

Please sign in to comment.