1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30

Fix unneeded binding

This commit is contained in:
Arkadiusz Fal 2022-12-13 20:15:22 +01:00
parent 0517b4feea
commit 14b894a2e9
2 changed files with 3 additions and 11 deletions

View File

@ -7,7 +7,6 @@ struct PlayerQueueRow: View {
let item: PlayerQueueItem
var history = false
var autoplay = false
@Binding var fullScreen: Bool
private var player = PlayerModel.shared
@ -15,11 +14,10 @@ struct PlayerQueueRow: View {
@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.history = history
self.autoplay = autoplay
_fullScreen = fullScreen
_watchRequest = FetchRequest<Watch>(
entity: Watch.entity(),
sortDescriptors: [],
@ -63,12 +61,6 @@ struct PlayerQueueRow: View {
player.advanceToItem(item, at: watchStoppedAt)
}
if fullScreen {
withAnimation {
fullScreen = false
}
}
if closePiPOnNavigation, player.playingInPictureInPicture {
player.closePiP()
}

View File

@ -86,7 +86,7 @@ struct PlayerQueueView: View {
}
ForEach(player.queue) { item in
PlayerQueueRow(item: item, fullScreen: $fullScreen)
PlayerQueueRow(item: item)
.contextMenu {
removeButton(item)
removeAllButton()
@ -107,7 +107,7 @@ struct PlayerQueueView: View {
if let related = player.currentVideo?.related, !related.isEmpty {
Section(header: Text("Related")) {
ForEach(related) { video in
PlayerQueueRow(item: PlayerQueueItem(video), fullScreen: $fullScreen)
PlayerQueueRow(item: PlayerQueueItem(video))
.contextMenu {
VideoContextMenuView(video: video)
}