1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user