diff --git a/apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift b/apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift index 678932d5ee..bc0a3b6650 100644 --- a/apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift +++ b/apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift @@ -689,8 +689,10 @@ private final class ReviewDiffContentView: UIView, UIGestureRecognizerDelegate { setNeedsDisplayForVisibleBounds() } } + private var _suppressTokensByRowIdDidSet = false var tokensByRowId: [String: [ReviewDiffNativeToken]] = [:] { didSet { + guard !_suppressTokensByRowIdDidSet else { return } tokenAttributedStringsByRowId.removeAll() clampHorizontalOffsets() setNeedsDisplayForVisibleBounds() @@ -698,10 +700,12 @@ private final class ReviewDiffContentView: UIView, UIGestureRecognizerDelegate { } func mergeTokensByRowId(_ tokensPatch: [String: [ReviewDiffNativeToken]]) { + _suppressTokensByRowIdDidSet = true tokensPatch.forEach { rowId, tokens in tokensByRowId[rowId] = tokens tokenAttributedStringsByRowId.removeValue(forKey: rowId) } + _suppressTokensByRowIdDidSet = false clampHorizontalOffsets() setNeedsDisplayForVisibleBounds() }