From 942386c56d65b4bbc346b67e4591e294fc71ea5f Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Tue, 30 Jan 2024 10:29:36 -0800 Subject: [PATCH] Reenable toggle on disallowing vpn (#2404) (#2416) 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)