This commit is contained in:
2025-12-12 14:16:48 +08:00
parent 6a5bda44e6
commit 3813974eae
8 changed files with 78 additions and 43 deletions

View File

@@ -174,17 +174,19 @@
[self.homeVM addUserCharacterWithId:cid emoji : emoji
completion:^(BOOL success, NSError * _Nullable error) {
if (!success) {
NSString *msg = error.localizedDescription ?: KBLocalized(@"Network error");
[KBHUD showInfo:msg];
return;
}
// if (!success) {
// NSString *msg = error.localizedDescription ?: KBLocalized(@"Network error");
// [KBHUD showInfo:msg];
// return;
// }
//
character.added = YES;
// UI
[self kb_refreshTopThreeView];
[self.tableView reloadData];
if (success) {
character.added = YES;
// UI
[self kb_refreshTopThreeView];
[self.tableView reloadData];
}
}];
}
@@ -221,21 +223,23 @@
[self.homeVM addUserCharacterWithId:cid emoji : emoji
completion:^(BOOL success, NSError * _Nullable error) {
if (!success) {
NSString *msg = error.localizedDescription ?: KBLocalized(@"Network error");
[KBHUD showInfo:msg];
return;
}
// if (!success) {
// NSString *msg = error.localizedDescription ?: KBLocalized(@"Network error");
// [KBHUD showInfo:msg];
// return;
// }
//
mc.added = YES;
NSMutableArray *m = [self.listCharacters mutableCopy];
[m replaceObjectAtIndex:current.row withObject:mc];
self.listCharacters = [m copy];
[self.tableView reloadRowsAtIndexPaths:@[current] withRowAnimation:UITableViewRowAnimationNone];
//
[self kb_refreshTopThreeView];
if (success) {
mc.added = YES;
NSMutableArray *m = [self.listCharacters mutableCopy];
[m replaceObjectAtIndex:current.row withObject:mc];
self.listCharacters = [m copy];
[self.tableView reloadRowsAtIndexPaths:@[current] withRowAnimation:UITableViewRowAnimationNone];
//
[self kb_refreshTopThreeView];
}
}];
};
return cell;