From a763e1d097c4b925ec29455656f80617748857b3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 22 Dec 2022 19:36:35 +0100 Subject: [PATCH] Fix Favorites performance --- Shared/Home/HistoryView.swift | 1 + Shared/Home/HomeView.swift | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Shared/Home/HistoryView.swift b/Shared/Home/HistoryView.swift index 6343f0a5..ad2726aa 100644 --- a/Shared/Home/HistoryView.swift +++ b/Shared/Home/HistoryView.swift @@ -29,6 +29,7 @@ struct HistoryView: View { } } } + .animation(nil, value: visibleWatches) .onAppear { visibleWatches .forEach(player.loadHistoryVideoDetails) diff --git a/Shared/Home/HomeView.swift b/Shared/Home/HomeView.swift index f76e245e..cfdb4496 100644 --- a/Shared/Home/HomeView.swift +++ b/Shared/Home/HomeView.swift @@ -80,18 +80,20 @@ struct HomeView: View { } if !accounts.current.isNil, showFavoritesInHome { - #if os(tvOS) - ForEach(Defaults[.favorites]) { item in - FavoriteItemView(item: item) - } - #else - ForEach(favorites) { item in - FavoriteItemView(item: item) - #if os(macOS) - .workaroundForVerticalScrollingBug() - #endif - } - #endif + LazyVStack(alignment: .leading) { + #if os(tvOS) + ForEach(Defaults[.favorites]) { item in + FavoriteItemView(item: item) + } + #else + ForEach(favorites) { item in + FavoriteItemView(item: item) + #if os(macOS) + .workaroundForVerticalScrollingBug() + #endif + } + #endif + } } #if os(iOS)