mirror of
https://github.com/yattee/yattee.git
synced 2026-01-11 06:12:33 +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 frontendURL = ""
|
||||||
@State private var proxiesVideos = false
|
@State private var proxiesVideos = false
|
||||||
@State private var invidiousCompanion = false
|
@State private var invidiousCompanion = false
|
||||||
|
@State private var hideVideosWithoutDuration = false
|
||||||
|
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
@ObservedObject private var accounts = AccountsModel.shared
|
@ObservedObject private var accounts = AccountsModel.shared
|
||||||
@@ -109,6 +110,18 @@ struct InstancesSettings: View {
|
|||||||
.onChange(of: invidiousCompanion) { newValue in
|
.onChange(of: invidiousCompanion) { newValue in
|
||||||
InstancesModel.shared.setInvidiousCompanion(selectedInstance, newValue)
|
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 {
|
if selectedInstance != nil, !selectedInstance.app.supportsAccounts {
|
||||||
@@ -201,6 +214,10 @@ struct InstancesSettings: View {
|
|||||||
private var invidiousCompanionToggle: some View {
|
private var invidiousCompanionToggle: some View {
|
||||||
Toggle("Invidious companion", isOn: $invidiousCompanion)
|
Toggle("Invidious companion", isOn: $invidiousCompanion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var hideVideosWithoutDurationToggle: some View {
|
||||||
|
Toggle("Experimental: Hide videos without duration", isOn: $hideVideosWithoutDuration)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InstancesSettingsView_Previews: PreviewProvider {
|
struct InstancesSettingsView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user