Extended Piped support

This commit is contained in:
Arkadiusz Fal
2021-10-21 00:21:50 +02:00
parent 2d075e7b3a
commit c3326a56af
46 changed files with 706 additions and 458 deletions

View File

@@ -3,7 +3,7 @@ import SwiftUI
struct AccountFormView: View {
let instance: Instance
var selectedAccount: Binding<Instance.Account?>?
var selectedAccount: Binding<Account?>?
@State private var name = ""
@State private var sid = ""
@@ -134,7 +134,7 @@ struct AccountFormView: View {
AccountValidator(
app: .constant(instance.app),
url: instance.url,
account: Instance.Account(instanceID: instance.id, url: instance.url, sid: sid),
account: Account(instanceID: instance.id, url: instance.url, sid: sid),
id: $sid,
isValid: $isValid,
isValidated: $isValidated,

View File

@@ -14,8 +14,8 @@ struct AccountsSettingsView: View {
}
var body: some View {
Group {
if instance.supportsAccounts {
VStack {
if instance.app.supportsAccounts {
accounts
} else {
Text("Accounts are not supported for the application of this instance")
@@ -68,7 +68,7 @@ struct AccountsSettingsView: View {
#endif
}
private func removeAccount(_ account: Instance.Account) {
private func removeAccount(_ account: Account) {
AccountsModel.remove(account)
accountsChanged.toggle()
}

View File

@@ -5,7 +5,7 @@ struct InstanceFormView: View {
@State private var name = ""
@State private var url = ""
@State private var app = Instance.App.invidious
@State private var app = VideosApp.invidious
@State private var isValid = false
@State private var isValidated = false
@@ -75,7 +75,7 @@ struct InstanceFormView: View {
private var formFields: some View {
Group {
Picker("Application", selection: $app) {
ForEach(Instance.App.allCases, id: \.self) { app in
ForEach(VideosApp.allCases, id: \.self) { app in
Text(app.rawValue.capitalized).tag(app)
}
}

View File

@@ -10,7 +10,7 @@ struct InstancesSettingsView: View {
@EnvironmentObject<PlaylistsModel> private var playlists
@State private var selectedInstanceID: Instance.ID?
@State private var selectedAccount: Instance.Account?
@State private var selectedAccount: Account?
@State private var presentingInstanceForm = false
@State private var savedFormInstanceID: Instance.ID?