Browse Source

fix triggerProgressTask

Marino Faggiana 7 years ago
parent
commit
dbaf7fa4ec
2 changed files with 7 additions and 3 deletions
  1. 6 2
      iOSClient/AppDelegate.m
  2. 1 1
      iOSClient/Main/CCMain.m

+ 6 - 2
iOSClient/AppDelegate.m

@@ -963,10 +963,14 @@
         
         UITabBarItem *tbItem = [tbc.tabBar.items objectAtIndex:0];
         
-        if (total > 0)
+        if (total > 0) {
             [tbItem setBadgeValue:[NSString stringWithFormat:@"%li", (unsigned long)total]];
-        else
+        } else {
             [tbItem setBadgeValue:nil];
+            
+            NSDictionary* userInfo = @{@"fileID": @"", @"serverUrl": @"", @"cryptated": [NSNumber numberWithFloat:0], @"progress": [NSNumber numberWithFloat:0]};
+            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
+        }
     }
 }
 

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -2777,7 +2777,7 @@
         [self.navigationController setCCProgressPercentage:progress*100 andTintColor: [NCBrandColor sharedInstance].navigationBarProgress];
     
     // Check
-    if (!fileID)
+    if (!fileID || [fileID isEqualToString: @""])
         return;
     
     [app.listProgressMetadata setObject:[NSNumber numberWithFloat:progress] forKey:fileID];