SyncService: Only require online connectivity when using Dropbox (#12520)

Aligns with the CloudStorage behavior.

Fix #12518
This commit is contained in:
NiLuJe
2024-09-16 17:10:45 +02:00
committed by GitHub
parent bf290e0c2b
commit aa6cadb1ee

View File

@@ -122,9 +122,17 @@ end
-- and renamed to replace the old cached file (thus the naming). The cached file stays (in the same folder) till being replaced
-- in the next round.
function SyncService.sync(server, file_path, sync_cb, is_silent)
if NetworkMgr:willRerunWhenOnline(function() SyncService.sync(server, file_path, sync_cb, is_silent) end) then
return
if server.type == "dropbox" then
if NetworkMgr:willRerunWhenOnline(function() SyncService.sync(server, file_path, sync_cb, is_silent) end) then
return
end
else
-- NOTE: Align behavior with CloudStorage:openCloudServer, where only Dropbox requires isOnline
if NetworkMgr:willRerunWhenConnected(function() SyncService.sync(server, file_path, sync_cb, is_silent) end) then
return
end
end
local file_name = ffiutil.basename(file_path)
local income_file_path = file_path .. ".temp" -- file downloaded from server
local cached_file_path = file_path .. ".sync" -- file uploaded to server last time