mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Fix placeholder cells
This commit is contained in:
parent
899e66b204
commit
33bd052fdc
@ -4,6 +4,7 @@ import SDWebImageSwiftUI
|
||||
import SwiftUI
|
||||
|
||||
struct VideoCell: View {
|
||||
var id: String?
|
||||
private var video: Video
|
||||
|
||||
@Environment(\.horizontalCells) private var horizontalCells
|
||||
@ -30,7 +31,8 @@ struct VideoCell: View {
|
||||
|
||||
@FetchRequest private var watchRequest: FetchedResults<Watch>
|
||||
|
||||
init(video: Video) {
|
||||
init(id: String? = nil, video: Video) {
|
||||
self.id = id
|
||||
self.video = video
|
||||
_watchRequest = video.watchFetchRequest
|
||||
}
|
||||
@ -52,7 +54,7 @@ struct VideoCell: View {
|
||||
.contextMenu {
|
||||
VideoContextMenuView(video: video)
|
||||
}
|
||||
.id(video.videoID)
|
||||
.id(id ?? video.videoID)
|
||||
}
|
||||
|
||||
private var thumbnailRoundingCornerRadius: Double {
|
||||
|
@ -3,7 +3,7 @@ import SwiftUI
|
||||
|
||||
struct PlaceholderCell: View {
|
||||
var body: some View {
|
||||
VideoCell(video: .fixture)
|
||||
VideoCell(id: UUID().uuidString, video: .fixture)
|
||||
.redacted(reason: .placeholder)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user