Skip to content

Commit

Permalink
fix(ios): remove invalid if statement at cell reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Aug 7, 2024
1 parent 4b2506e commit 22c99ec
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell

UIView *cellView = nil;
UIView *cachedVisibleCellView = [_cachedWeakCellViews objectForKey:shadowView.hippyTag];
if (cachedVisibleCellView &&
[shadowView isKindOfClass:HippyShadowWaterfallItem.class] &&
!((HippyShadowWaterfallItem *)shadowView).layoutDirty) {
if (cachedVisibleCellView) {
cellView = cachedVisibleCellView;
HippyLogTrace(@"🟢 use cached visible cellView at %@ for %@", indexPath, shadowView.hippyTag);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
/// Waterfall item's shadowView
@interface HippyShadowWaterfallItem : HippyShadowView

@property (nonatomic, assign, getter=isLayoutDirty) BOOL layoutDirty;

/// frame change observer, usually is shadowListView
@property (nonatomic, weak) id<HippyShadowWaterfallItemFrameChangedProtocol> observer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,7 @@ - (void)amendLayoutBeforeMount:(NSMutableSet<NativeRenderApplierBlock> *)blocks
// If item has not yet been created, then no need to collect blocks.
return;
}
_layoutDirty = NO;
if (NativeRenderUpdateLifecycleComputed == _propagationLifecycle) {
return;
}
if (NativeRenderUpdateLifecycleLayoutDirtied == _propagationLifecycle) {
_layoutDirty = YES;
}
_propagationLifecycle = NativeRenderUpdateLifecycleComputed;
for (HippyShadowView *renderObjectView in self.hippySubviews) {
[renderObjectView amendLayoutBeforeMount:blocks];
}
[super amendLayoutBeforeMount:blocks];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell

UIView *cellView = nil;
UIView *cachedCellView = [_cachedWeakCellViews objectForKey:shadowView.hippyTag];
if (cachedCellView &&
[shadowView isKindOfClass:HippyShadowWaterfallItem.class] &&
!((HippyShadowWaterfallItem *)shadowView).layoutDirty) {
if (cachedCellView) {
cellView = cachedCellView;
} else {
cellView = [self.uiManager createViewForShadowListItem:shadowView];
Expand Down

0 comments on commit 22c99ec

Please sign in to comment.