Fix Favorites performance

This commit is contained in:
Arkadiusz Fal 2022-12-22 19:36:35 +01:00
parent 3661d06080
commit a763e1d097
2 changed files with 15 additions and 12 deletions

View File

@ -29,6 +29,7 @@ struct HistoryView: View {
}
}
}
.animation(nil, value: visibleWatches)
.onAppear {
visibleWatches
.forEach(player.loadHistoryVideoDetails)

View File

@ -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)