mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 05:40:32 +05:30
Fix removing instance
This commit is contained in:
parent
c94687f54e
commit
dd8d6b6c4a
@ -28,8 +28,8 @@ struct Account: Defaults.Serializable, Hashable, Identifiable {
|
|||||||
self.sid = sid ?? ""
|
self.sid = sid ?? ""
|
||||||
}
|
}
|
||||||
|
|
||||||
var instance: Instance {
|
var instance: Instance! {
|
||||||
Defaults[.instances].first { $0.id == instanceID }!
|
Defaults[.instances].first { $0.id == instanceID }
|
||||||
}
|
}
|
||||||
|
|
||||||
var anonymizedSID: String {
|
var anonymizedSID: String {
|
||||||
|
@ -23,7 +23,7 @@ final class AccountsModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var app: VideosApp {
|
var app: VideosApp {
|
||||||
current?.instance.app ?? .invidious
|
current?.instance?.app ?? .invidious
|
||||||
}
|
}
|
||||||
|
|
||||||
var api: VideosAPI {
|
var api: VideosAPI {
|
||||||
|
@ -13,11 +13,14 @@ struct SettingsView: View {
|
|||||||
@Environment(\.dismiss) private var dismiss
|
@Environment(\.dismiss) private var dismiss
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@EnvironmentObject<AccountsModel> private var accounts
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
TabView {
|
TabView {
|
||||||
Form {
|
Form {
|
||||||
InstancesSettings()
|
InstancesSettings()
|
||||||
|
.environmentObject(accounts)
|
||||||
}
|
}
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label("Instances", systemImage: "server.rack")
|
Label("Instances", systemImage: "server.rack")
|
||||||
@ -63,6 +66,7 @@ struct SettingsView: View {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
InstancesSettings()
|
InstancesSettings()
|
||||||
|
.environmentObject(accounts)
|
||||||
BrowsingSettings()
|
BrowsingSettings()
|
||||||
PlaybackSettings()
|
PlaybackSettings()
|
||||||
ServicesSettings()
|
ServicesSettings()
|
||||||
|
@ -54,7 +54,6 @@ struct VerticalCells: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var scrollViewShowsIndicators: Bool {
|
var scrollViewShowsIndicators: Bool {
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
true
|
true
|
||||||
|
@ -26,6 +26,7 @@ struct YatteeApp: App {
|
|||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
Settings {
|
Settings {
|
||||||
SettingsView()
|
SettingsView()
|
||||||
|
.environmentObject(AccountsModel())
|
||||||
.environmentObject(InstancesModel())
|
.environmentObject(InstancesModel())
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user