1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30

Add proxy video setting to macOS

This commit is contained in:
Arkadiusz Fal 2022-08-16 23:23:22 +02:00
parent bca909aab6
commit d7aba17bc5

View File

@ -13,6 +13,7 @@ struct InstancesSettings: View {
@State private var presentingInstanceRemovalConfirmation = false
@State private var frontendURL = ""
@State private var proxiesVideos = false
@Environment(\.colorScheme) private var colorScheme
@EnvironmentObject<AccountsModel> private var accounts
@ -98,6 +99,16 @@ struct InstancesSettings: View {
.foregroundColor(.secondary)
}
if selectedInstance != nil, selectedInstance.app.allowsDisablingVidoesProxying {
proxiesVideosToggle
.onAppear {
proxiesVideos = selectedInstance.proxiesVideos
}
.onChange(of: proxiesVideos) { newValue in
InstancesModel.setProxiesVideos(selectedInstance, newValue)
}
}
if selectedInstance != nil, !selectedInstance.app.supportsAccounts {
Spacer()
Text("Accounts are not supported for the application of this instance")
@ -177,6 +188,10 @@ struct InstancesSettings: View {
return InstancesModel.accounts(selectedInstanceID)
}
private var proxiesVideosToggle: some View {
Toggle("Proxy videos", isOn: $proxiesVideos)
}
}
struct InstancesSettingsView_Previews: PreviewProvider {