only post activity notification once after cancels

This commit is contained in:
Justin R. Miller
2014-02-20 00:16:54 -08:00
parent eac69ae30c
commit cfbde82429

View File

@@ -420,14 +420,10 @@ namespace llmr
[[NSURLSession sharedSession] getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks)
{
for (NSURLSessionDownloadTask *task in downloadTasks)
{
if (task.taskDescription && ! [task.taskDescription isEqualToString:latestZoom])
{
[task cancel];
[[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil];
}
}
[[NSNotificationCenter defaultCenter] postNotificationName:MBXUpdateActivityNotification object:nil];
}];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@(url.c_str())] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)