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