Marino Faggiana 6 năm trước cách đây
mục cha
commit
516067930b
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      iOSClient/Networking/CCNetworking.m

+ 8 - 0
iOSClient/Networking/CCNetworking.m

@@ -566,6 +566,10 @@
     NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl];
     if (!directoryID) return;
     
+    if (totalBytesExpectedToWrite < 1) {
+        totalBytesExpectedToWrite = totalBytesWritten;
+    }
+        
     float progress = (float) totalBytesWritten / (float)totalBytesExpectedToWrite;
     
     tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataInSessionFromFileName:fileName directoryID:directoryID];
@@ -987,6 +991,10 @@
     NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:serverUrl];
     if (!directoryID) return;
     
+    if (totalBytesExpectedToSend < 1) {
+        totalBytesExpectedToSend = totalBytesSent;
+    }
+    
     float progress = (float) totalBytesSent / (float)totalBytesExpectedToSend;
 
     tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataInSessionFromFileName:fileName directoryID:directoryID];