mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Add demo instance, remove public manifest
This commit is contained in:
@@ -8,6 +8,7 @@ struct AccountsNavigationLink: View {
|
||||
NavigationLink(instance.longDescription) {
|
||||
InstanceSettings(instance: instance)
|
||||
}
|
||||
.disabled(instance.app == .demoApp)
|
||||
.buttonStyle(.plain)
|
||||
.contextMenu {
|
||||
removeInstanceButton(instance)
|
||||
|
@@ -41,28 +41,30 @@ struct LocationsSettings: View {
|
||||
}
|
||||
|
||||
@ViewBuilder var settings: some View {
|
||||
Section(header: SettingsHeader(text: "Public Locations".localized()), footer: countryFooter) {
|
||||
Picker("Country", selection: $countryOfPublicInstances) {
|
||||
Text("Don't use public locations").tag(String?.none)
|
||||
ForEach(countries, id: \.self) { country in
|
||||
Text(country).tag(Optional(country))
|
||||
if !InstancesManifest.shared.manifestURL.isNil {
|
||||
Section(header: SettingsHeader(text: "Public Locations".localized()), footer: countryFooter) {
|
||||
Picker("Country", selection: $countryOfPublicInstances) {
|
||||
Text("Don't use public locations").tag(String?.none)
|
||||
ForEach(countries, id: \.self) { country in
|
||||
Text(country).tag(Optional(country))
|
||||
}
|
||||
}
|
||||
}
|
||||
#if os(tvOS)
|
||||
.pickerStyle(.inline)
|
||||
#endif
|
||||
.disabled(countries.isEmpty)
|
||||
#if os(tvOS)
|
||||
.pickerStyle(.inline)
|
||||
#endif
|
||||
.disabled(countries.isEmpty)
|
||||
|
||||
Button {
|
||||
InstancesManifest.shared.changePublicAccount(accounts, settings: model)
|
||||
} label: {
|
||||
if let account = accounts.current, account.isPublic {
|
||||
Text("Switch to other public location")
|
||||
} else {
|
||||
Text("Switch to public locations")
|
||||
Button {
|
||||
InstancesManifest.shared.changePublicAccount(accounts, settings: model)
|
||||
} label: {
|
||||
if let account = accounts.current, account.isPublic {
|
||||
Text("Switch to other public location")
|
||||
} else {
|
||||
Text("Switch to public locations")
|
||||
}
|
||||
}
|
||||
.disabled(countryOfPublicInstances.isNil)
|
||||
}
|
||||
.disabled(countryOfPublicInstances.isNil)
|
||||
}
|
||||
|
||||
Section(header: SettingsHeader(text: "Custom Locations".localized())) {
|
||||
@@ -92,7 +94,8 @@ struct LocationsSettings: View {
|
||||
}
|
||||
|
||||
func loadCountries() {
|
||||
InstancesManifest.shared.instancesList.load()
|
||||
InstancesManifest.shared.configure()
|
||||
InstancesManifest.shared.instancesList?.load()
|
||||
.onSuccess { response in
|
||||
if let instances: [ManifestedInstance] = response.typedContent() {
|
||||
self.countries = instances.map(\.country).unique().sorted()
|
||||
|
@@ -31,6 +31,7 @@ struct PlayerSettings: View {
|
||||
@Default(.enableReturnYouTubeDislike) private var enableReturnYouTubeDislike
|
||||
@Default(.systemControlsCommands) private var systemControlsCommands
|
||||
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
@EnvironmentObject<PlayerModel> private var player
|
||||
|
||||
#if os(iOS)
|
||||
@@ -99,7 +100,10 @@ struct PlayerSettings: View {
|
||||
|
||||
keywordsToggle
|
||||
showHistoryToggle
|
||||
returnYouTubeDislikeToggle
|
||||
|
||||
if !accounts.isDemo {
|
||||
returnYouTubeDislikeToggle
|
||||
}
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
|
Reference in New Issue
Block a user