Kosync network callback (#6489)

reviewable/pr6514/r1 v2020.08
Galunid 4 years ago committed by GitHub
parent 986f45871a
commit d90e221a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,4 @@
local NetworkMgr = require("ui/network/manager")
local UIManager = require("ui/uimanager")
local DEBUG = require("dbg")
@ -103,6 +104,21 @@ function KOSyncClient:update_progress(
device,
device_id,
callback)
local callback_ok = NetworkMgr:willRerunWhenOnline(function()
self:update_progress(
username,
password,
document,
progress,
percentage,
device,
device_id,
callback)
end)
if callback_ok then
return
end
self.client:reset_middlewares()
self.client:enable('Format.JSON')
self.client:enable("GinClient")
@ -137,6 +153,11 @@ function KOSyncClient:get_progress(
password,
document,
callback)
if NetworkMgr:willRerunWhenOnline(function() self:get_progress(username, password, document, callback) end) then
return
end
self.client:reset_middlewares()
self.client:enable('Format.JSON')
self.client:enable("GinClient")

Loading…
Cancel
Save