1
This commit is contained in:
@@ -134,6 +134,10 @@
|
||||
KBWeakSelf
|
||||
__weak typeof(cell) weakCell = cell;
|
||||
cell.onTapAction = ^{
|
||||
if (![KBUserSessionManager shared].isLoggedIn) {
|
||||
[[KBUserSessionManager shared] goLoginVC];
|
||||
return;
|
||||
}
|
||||
__strong typeof(weakSelf) self = weakSelf;
|
||||
HomeRankCardCell *strongCell = weakCell;
|
||||
if (!self || !strongCell) { return; }
|
||||
@@ -153,18 +157,20 @@
|
||||
|
||||
[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;
|
||||
// }
|
||||
|
||||
// 添加成功:更新模型状态并刷新该 item(按钮变为已添加且不可再点)
|
||||
mc.added = YES;
|
||||
NSMutableArray *m = [self.characters mutableCopy];
|
||||
[m replaceObjectAtIndex:currentIndexPath.item withObject:mc];
|
||||
self.characters = [m copy];
|
||||
[self.collectionView reloadItemsAtIndexPaths:@[currentIndexPath]];
|
||||
if (success) {
|
||||
mc.added = YES;
|
||||
NSMutableArray *m = [self.characters mutableCopy];
|
||||
[m replaceObjectAtIndex:currentIndexPath.item withObject:mc];
|
||||
self.characters = [m copy];
|
||||
[self.collectionView reloadItemsAtIndexPaths:@[currentIndexPath]];
|
||||
}
|
||||
}];
|
||||
};
|
||||
return cell;
|
||||
|
||||
Reference in New Issue
Block a user