From 10fb417d87510a84ffdca401ad191fbde5416012 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 16 Aug 2022 23:23:22 +0200 Subject: [PATCH] Add proxy video setting to macOS --- macOS/InstancesSettings.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/macOS/InstancesSettings.swift b/macOS/InstancesSettings.swift index 6317c6fb..cd848fd6 100644 --- a/macOS/InstancesSettings.swift +++ b/macOS/InstancesSettings.swift @@ -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 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 {