From aa6cadb1ee14e6bf9a73b02f785fd3f32f362a11 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 16 Sep 2024 17:10:45 +0200 Subject: [PATCH] SyncService: Only require online connectivity when using Dropbox (#12520) Aligns with the CloudStorage behavior. Fix #12518 --- frontend/apps/cloudstorage/syncservice.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/apps/cloudstorage/syncservice.lua b/frontend/apps/cloudstorage/syncservice.lua index 8e254268e..754280096 100644 --- a/frontend/apps/cloudstorage/syncservice.lua +++ b/frontend/apps/cloudstorage/syncservice.lua @@ -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