mirror of
				https://github.com/yattee/yattee.git
				synced 2025-11-03 22:22:02 +00:00 
			
		
		
		
	Add proxy video setting to macOS
This commit is contained in:
		@@ -13,6 +13,7 @@ struct InstancesSettings: View {
 | 
				
			|||||||
    @State private var presentingInstanceRemovalConfirmation = false
 | 
					    @State private var presentingInstanceRemovalConfirmation = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @State private var frontendURL = ""
 | 
					    @State private var frontendURL = ""
 | 
				
			||||||
 | 
					    @State private var proxiesVideos = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Environment(\.colorScheme) private var colorScheme
 | 
					    @Environment(\.colorScheme) private var colorScheme
 | 
				
			||||||
    @EnvironmentObject<AccountsModel> private var accounts
 | 
					    @EnvironmentObject<AccountsModel> private var accounts
 | 
				
			||||||
@@ -98,6 +99,16 @@ struct InstancesSettings: View {
 | 
				
			|||||||
                    .foregroundColor(.secondary)
 | 
					                    .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 {
 | 
					            if selectedInstance != nil, !selectedInstance.app.supportsAccounts {
 | 
				
			||||||
                Spacer()
 | 
					                Spacer()
 | 
				
			||||||
                Text("Accounts are not supported for the application of this instance")
 | 
					                Text("Accounts are not supported for the application of this instance")
 | 
				
			||||||
@@ -177,6 +188,10 @@ struct InstancesSettings: View {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return InstancesModel.accounts(selectedInstanceID)
 | 
					        return InstancesModel.accounts(selectedInstanceID)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private var proxiesVideosToggle: some View {
 | 
				
			||||||
 | 
					        Toggle("Proxy videos", isOn: $proxiesVideos)
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct InstancesSettingsView_Previews: PreviewProvider {
 | 
					struct InstancesSettingsView_Previews: PreviewProvider {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user