Fix some threading issues.
This commit is contained in:
1 parent
cd67331db2
commit
11028208b8
4 files changed
+128
-103
No files matched your search
@@ -70,11 +70,13 @@ static void *SBItemViewContex = &SBItemViewContex;
|
||||
// is different from ready
|
||||
if ([keyPath isEqualToString:@"item.status"]) {
|
||||
SBQueueItemStatus newStatus = [[change valueForKey:NSKeyValueChangeNewKey] integerValue];
|
||||
if (newStatus != SBQueueItemStatusReady && newStatus != SBQueueItemStatusEditing) {
|
||||
[self.editButton setEnabled:NO];
|
||||
} else {
|
||||
[self.editButton setEnabled:YES];
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (newStatus != SBQueueItemStatusReady && newStatus != SBQueueItemStatusEditing) {
|
||||
[self.editButton setEnabled:NO];
|
||||
} else {
|
||||
[self.editButton setEnabled:YES];
|
||||
}
|
||||
});
|
||||
} else if ([keyPath isEqualToString:@"item.actions"]) {
|
||||
NSInteger count = [change[NSKeyValueChangeNewKey] count] - [change[NSKeyValueChangeOldKey] count];
|
||||
CGFloat height = TABLE_ROW_HEIGHT * (count >= 0 ? count : 1);
|
||||
|
||||
Reference in new issue
Block a user