mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 05:53:41 +00:00
Fix unneeded binding
This commit is contained in:
parent
0517b4feea
commit
14b894a2e9
@ -7,7 +7,6 @@ struct PlayerQueueRow: View {
|
|||||||
let item: PlayerQueueItem
|
let item: PlayerQueueItem
|
||||||
var history = false
|
var history = false
|
||||||
var autoplay = false
|
var autoplay = false
|
||||||
@Binding var fullScreen: Bool
|
|
||||||
|
|
||||||
private var player = PlayerModel.shared
|
private var player = PlayerModel.shared
|
||||||
|
|
||||||
@ -15,11 +14,10 @@ struct PlayerQueueRow: View {
|
|||||||
|
|
||||||
@FetchRequest private var watchRequest: FetchedResults<Watch>
|
@FetchRequest private var watchRequest: FetchedResults<Watch>
|
||||||
|
|
||||||
init(item: PlayerQueueItem, history: Bool = false, autoplay: Bool = false, fullScreen: Binding<Bool> = .constant(false)) {
|
init(item: PlayerQueueItem, history: Bool = false, autoplay: Bool = false) {
|
||||||
self.item = item
|
self.item = item
|
||||||
self.history = history
|
self.history = history
|
||||||
self.autoplay = autoplay
|
self.autoplay = autoplay
|
||||||
_fullScreen = fullScreen
|
|
||||||
_watchRequest = FetchRequest<Watch>(
|
_watchRequest = FetchRequest<Watch>(
|
||||||
entity: Watch.entity(),
|
entity: Watch.entity(),
|
||||||
sortDescriptors: [],
|
sortDescriptors: [],
|
||||||
@ -63,12 +61,6 @@ struct PlayerQueueRow: View {
|
|||||||
player.advanceToItem(item, at: watchStoppedAt)
|
player.advanceToItem(item, at: watchStoppedAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
if fullScreen {
|
|
||||||
withAnimation {
|
|
||||||
fullScreen = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if closePiPOnNavigation, player.playingInPictureInPicture {
|
if closePiPOnNavigation, player.playingInPictureInPicture {
|
||||||
player.closePiP()
|
player.closePiP()
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ struct PlayerQueueView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ForEach(player.queue) { item in
|
ForEach(player.queue) { item in
|
||||||
PlayerQueueRow(item: item, fullScreen: $fullScreen)
|
PlayerQueueRow(item: item)
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
removeButton(item)
|
removeButton(item)
|
||||||
removeAllButton()
|
removeAllButton()
|
||||||
@ -107,7 +107,7 @@ struct PlayerQueueView: View {
|
|||||||
if let related = player.currentVideo?.related, !related.isEmpty {
|
if let related = player.currentVideo?.related, !related.isEmpty {
|
||||||
Section(header: Text("Related")) {
|
Section(header: Text("Related")) {
|
||||||
ForEach(related) { video in
|
ForEach(related) { video in
|
||||||
PlayerQueueRow(item: PlayerQueueItem(video), fullScreen: $fullScreen)
|
PlayerQueueRow(item: PlayerQueueItem(video))
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
VideoContextMenuView(video: video)
|
VideoContextMenuView(video: video)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user