From 583ec56d20e3504cb07ac55bf540eafc811fb01c Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 2 Nov 2023 12:07:23 +0800 Subject: [PATCH] Simplify top item expression --- .../Sources/App/Views/Home/HomeFeedViewIOS.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index 7a79983f4..6eb0891f0 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -563,10 +563,8 @@ struct AnimatingCellHeight: AnimatableModifier { }) .onPreferenceChange(ScrollOffsetPreferenceKey.self) { value in if value.y < 100, value.y > 0 { - if let date = item.savedAt { - if topItem != item { - setTopItem(item) - } + if item.savedAt != nil && topItem != item { + setTopItem(item) } } }