Marino Faggiana 6 éve
szülő
commit
04f9616756
2 módosított fájl, 19 hozzáadás és 1 törlés
  1. 14 0
      Share/ShareViewController.m
  2. 5 1
      iOSClient/Main/NCMainCommon.swift

+ 14 - 0
Share/ShareViewController.m

@@ -225,6 +225,20 @@
                 
                 [CCUtility copyFileAtPath:fileNameLocal toPath:[CCUtility getDirectoryProviderStorageFileID:fileID fileNameView:fileNameForUpload]];
                 
+                tableMetadata *metadata = [tableMetadata new];
+                
+                metadata.account = self.activeAccount;
+                metadata.date = date;
+                metadata.etag = etag;
+                metadata.fileID = fileID;
+                metadata.fileName = fileNameForUpload;
+                metadata.fileNameView = fileNameForUpload;
+                metadata.serverUrl = self.serverUrl;
+                (void)[CCUtility insertTypeFileIconName:fileNameForUpload metadata:metadata];
+                
+                metadata = [[NCManageDatabase sharedInstance] addMetadata:metadata];
+                [[NCManageDatabase sharedInstance] addLocalFileWithMetadata:metadata];
+                
                 [self.shareTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
                 [self performSelector:@selector(selectPost) withObject:nil];
                 

+ 5 - 1
iOSClient/Main/NCMainCommon.swift

@@ -1249,7 +1249,11 @@ class NCNetworkingMain: NSObject, CCNetworkingDelegate {
                         }
                         if view is UITableView && CCUtility.fileProviderStorageIconExists(metadata.fileID, fileNameView: metadata.fileName) && NCMainCommon.sharedInstance.isValidIndexPath(indexPath, view: view) {
                             if let cell = (view as! UITableView).cellForRow(at: indexPath) {
-                                (cell as! CCCellMain).file.image = image
+                                if cell is CCCellMainTransfer {
+                                    (cell as! CCCellMainTransfer).file.image = image
+                                } else if cell is CCCellMain {
+                                    (cell as! CCCellMain).file.image = image
+                                }
                             }
                         }
                     }