Skip to content

Commit

Permalink
Don't restore wifi if enabled through autowifi
Browse files Browse the repository at this point in the history
  • Loading branch information
Billiam committed Jan 12, 2025
1 parent 1fee2c6 commit ff74f1e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hardcover/lib/auto_wifi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function AutoWifi:withWifi(callback)

if self.settings:readSetting(SETTING.ENABLE_WIFI) and not NetworkMgr.pending_connection and Device:hasWifiRestore() then
--logger.warn("HARDCOVER enabling wifi")

local original_on = NetworkMgr.wifi_was_on

NetworkMgr:restoreWifiAsync()
Expand All @@ -36,10 +37,12 @@ function AutoWifi:withWifi(callback)
callback()

-- TODO: schedule turn off wifi, debounce
NetworkMgr:turnOffWifi()
--NetworkMgr:turnOffWifi(function()
-- logger.warn("HARDCOVER disabling wifi")
--end)
NetworkMgr:turnOffWifi(function()
-- explicitly disable wifi was on
NetworkMgr.wifi_was_on = false
G_reader_settings:saveSetting("wifi_was_on", false)
--logger.warn("HARDCOVER disabling wifi")
end)
end)
end
end
Expand Down

0 comments on commit ff74f1e

Please sign in to comment.