Skip to content

Commit de5eac9

Browse files
Fix mod manager swipe action completion crash
1 parent c5e51cd commit de5eac9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Natives/installer/mods/ModManagerViewController.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ - (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwip
421421
BOOL enabled = [mod[@"enabled"] boolValue];
422422
UIContextualAction *toggle = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:(enabled ? @"Disable" : @"Enable") handler:^(UIContextualAction *action, UIView *sourceView, void (^completionHandler)(BOOL)) {
423423
if (enabled) {
424-
[self disableModWithDependents:mod completion:completionHandler];
424+
completionHandler(YES);
425+
[self disableModWithDependents:mod completion:nil];
425426
} else {
426427
NSError *error = nil;
427428
BOOL ok = [self.store enableMod:mod error:&error];
@@ -435,7 +436,8 @@ - (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwip
435436
toggle.backgroundColor = UIColor.systemBlueColor;
436437

437438
UIContextualAction *remove = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:@"Remove" handler:^(UIContextualAction *action, UIView *sourceView, void (^completionHandler)(BOOL)) {
438-
[self removeModWithDependents:mod completion:completionHandler];
439+
completionHandler(YES);
440+
[self removeModWithDependents:mod completion:nil];
439441
}];
440442
return [UISwipeActionsConfiguration configurationWithActions:@[remove, toggle]];
441443
}

0 commit comments

Comments
 (0)