mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Prompt users to turn on Wifi in Cloud Storage and OPDS Browser (#2650)
* prompt users to turn on Wifi in Cloud Storage and OPDS Browser
This commit is contained in:
@@ -101,6 +101,11 @@ end
|
||||
|
||||
function CloudStorage:openCloudServer(url)
|
||||
local tbl
|
||||
local NetworkMgr = require("ui/network/manager")
|
||||
if not NetworkMgr:isOnline() then
|
||||
NetworkMgr:promptWifiOn()
|
||||
return
|
||||
end
|
||||
if self.type == "dropbox" then
|
||||
tbl = DropBox:run(url, self.password)
|
||||
elseif self.type == "ftp" then
|
||||
|
||||
@@ -353,8 +353,7 @@ end
|
||||
|
||||
function OPDSBrowser:getCatalog(feed_url)
|
||||
local ok, catalog = pcall(self.parseFeed, self, feed_url)
|
||||
-- prompt users to turn on Wifi if network is unreachable
|
||||
if not ok and catalog and (catalog:find("Network is unreachable") or catalog:find("host or service not provided")) then
|
||||
if not ok and catalog and not NetworkMgr:isOnline() then
|
||||
NetworkMgr:promptWifiOn()
|
||||
return
|
||||
elseif not ok and catalog then
|
||||
|
||||
Reference in New Issue
Block a user