Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
sablib committed Jan 6, 2016
1 parent ab9360e commit 23954a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ZZOperationExtension/Classes/ZZExclusivityController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ - (void)noqueue_addOperation:(ZZOperation *)operation category:(NSString *)categ
if (operationsWithThisCategories.count) {
[operationsWithThisCategories makeObjectsPerformSelector:@selector(cancel)];
}
} else if ([category hasPrefix:@"KeepFirstExclusive"]) {
if (operationsWithThisCategories.count && [operationsWithThisCategories zz_filter:^BOOL(NSOperation *each) {
return ![each isCancelled];
}].count) {
[operation cancel];
}
} else {
if (operationsWithThisCategories.count) {
ZZOperation *last = operationsWithThisCategories.lastObject;
Expand Down

0 comments on commit 23954a9

Please sign in to comment.