Channels performance improvements

Add settings:
Show channel avatars in channels lists
Show channel avatars in videos lists

Fix #508
This commit is contained in:
Arkadiusz Fal
2023-07-22 19:02:59 +02:00
parent 37a96a01db
commit 3c9e04d243
14 changed files with 81 additions and 71 deletions

View File

@@ -50,6 +50,8 @@ struct RecentNavigationLink<DestinationContent: View>: View {
var recents = RecentsModel.shared
@ObservedObject private var navigation = NavigationModel.shared
@Default(.showChannelAvatarInChannelsLists) private var showChannelAvatarInChannelsLists
var recent: RecentItem
var systemImage: String?
let destination: DestinationContent
@@ -71,9 +73,10 @@ struct RecentNavigationLink<DestinationContent: View>: View {
HStack {
if recent.type == .channel,
let channel = recent.channel,
channel.thumbnailURLOrCached != nil
showChannelAvatarInChannelsLists
{
ChannelAvatarView(channel: channel, subscribedBadge: false)
.id("channel-avatar-\(channel.id)")
.frame(width: Constants.sidebarChannelThumbnailSize, height: Constants.sidebarChannelThumbnailSize)
Text(channel.name)