From ca423f2887260c8f98730f8d0fec6ffd60e2a832 Mon Sep 17 00:00:00 2001 From: yparitcher Date: Thu, 5 May 2022 01:31:36 -0400 Subject: [PATCH] Network: ToggleWiFi: check `isWifiOn` instead of `isConnected` (#9067) Rationale from: https://github.com/koreader/koreader/pull/9064#issuecomment-1116485065 >While we are dealing with WiFi, a slight hijack, on my kindle when the WiFi is on but not connected the ToggleWiFi gesture tries to connect so i have no way of turning it off. For eample I use the gesture to turn it on, then leave the range I can't use it to turn off. I think the more direct approach would be to toggle On -> Off states so if i am disconnected and want to reconnect i can always go Off then On, but I am able to turn it off. >TLDR: the tooglewifi gesture should check for iswififup not isconnected --- frontend/ui/network/networklistener.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ui/network/networklistener.lua b/frontend/ui/network/networklistener.lua index cdd9d73fc..8850348d6 100644 --- a/frontend/ui/network/networklistener.lua +++ b/frontend/ui/network/networklistener.lua @@ -12,7 +12,7 @@ local T = require("ffi/util").template local NetworkListener = InputContainer:new{} function NetworkListener:onToggleWifi() - if not NetworkMgr:isConnected() then + if not NetworkMgr:isWifiOn() then UIManager:show(InfoMessage:new{ text = _("Turning on Wi-Fi…"), timeout = 1,