mirror of
https://github.com/yattee/yattee.git
synced 2025-11-24 18:28:20 +00:00
Add hide videos without duration setting to macOS instance settings
Added the "Experimental: Hide videos without duration" toggle to the macOS instance settings view to match the iOS/tvOS implementation.
This commit is contained in:
@@ -12,6 +12,7 @@ struct InstancesSettings: View {
|
||||
@State private var frontendURL = ""
|
||||
@State private var proxiesVideos = false
|
||||
@State private var invidiousCompanion = false
|
||||
@State private var hideVideosWithoutDuration = false
|
||||
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
@@ -109,6 +110,18 @@ struct InstancesSettings: View {
|
||||
.onChange(of: invidiousCompanion) { newValue in
|
||||
InstancesModel.shared.setInvidiousCompanion(selectedInstance, newValue)
|
||||
}
|
||||
|
||||
hideVideosWithoutDurationToggle
|
||||
.onAppear {
|
||||
hideVideosWithoutDuration = selectedInstance.hideVideosWithoutDuration
|
||||
}
|
||||
.onChange(of: hideVideosWithoutDuration) { newValue in
|
||||
InstancesModel.shared.setHideVideosWithoutDuration(selectedInstance, newValue)
|
||||
}
|
||||
|
||||
Text("This can be used to hide shorts")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
if selectedInstance != nil, !selectedInstance.app.supportsAccounts {
|
||||
@@ -201,6 +214,10 @@ struct InstancesSettings: View {
|
||||
private var invidiousCompanionToggle: some View {
|
||||
Toggle("Invidious companion", isOn: $invidiousCompanion)
|
||||
}
|
||||
|
||||
private var hideVideosWithoutDurationToggle: some View {
|
||||
Toggle("Experimental: Hide videos without duration", isOn: $hideVideosWithoutDuration)
|
||||
}
|
||||
}
|
||||
|
||||
struct InstancesSettingsView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user