From 7be056595ed0f3e0363d95aaf0a4b892025bfa5b Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Mon, 29 Jan 2024 23:19:33 +0100 Subject: [PATCH] Reenable toggle on disallowing vpn (#2404) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task/Issue URL: https://app.asana.com/0/0/1206463994034099/f Description: When “Don’t Allow” is tapped, the dialog is dismissed and the toggle is greyed out. We have to back out of the screen and reopen the VPN screen to give it another attempt. Reenable the button again when the VPN permission is denied. This can be solved by simply reenabling the toggle after it’s been disabled for 2 seconds, something we were already sort of doing to stop spamming. This just slightly reworks the logic to cover more scenarios. --- DuckDuckGo/NetworkProtectionStatusViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DuckDuckGo/NetworkProtectionStatusViewModel.swift b/DuckDuckGo/NetworkProtectionStatusViewModel.swift index 881d49e8b2..ab3ca1f57b 100644 --- a/DuckDuckGo/NetworkProtectionStatusViewModel.swift +++ b/DuckDuckGo/NetworkProtectionStatusViewModel.swift @@ -156,7 +156,7 @@ final class NetworkProtectionStatusViewModel: ObservableObject { // Set up a delayed publisher to fire just once that reenables the toggle // Each event cancels the previous delayed publisher - isLoadingPublisher + $shouldDisableToggle .filter { $0 } .map { Just(!$0)