mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
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 ?? ""
|
||||
}
|
||||
|
||||
var instance: Instance {
|
||||
Defaults[.instances].first { $0.id == instanceID }!
|
||||
var instance: Instance! {
|
||||
Defaults[.instances].first { $0.id == instanceID }
|
||||
}
|
||||
|
||||
var anonymizedSID: String {
|
||||
|
@ -23,7 +23,7 @@ final class AccountsModel: ObservableObject {
|
||||
}
|
||||
|
||||
var app: VideosApp {
|
||||
current?.instance.app ?? .invidious
|
||||
current?.instance?.app ?? .invidious
|
||||
}
|
||||
|
||||
var api: VideosAPI {
|
||||
|
@ -13,11 +13,14 @@ struct SettingsView: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
#endif
|
||||
|
||||
@EnvironmentObject<AccountsModel> private var accounts
|
||||
|
||||
var body: some View {
|
||||
#if os(macOS)
|
||||
TabView {
|
||||
Form {
|
||||
InstancesSettings()
|
||||
.environmentObject(accounts)
|
||||
}
|
||||
.tabItem {
|
||||
Label("Instances", systemImage: "server.rack")
|
||||
@ -63,6 +66,7 @@ struct SettingsView: View {
|
||||
}
|
||||
#endif
|
||||
InstancesSettings()
|
||||
.environmentObject(accounts)
|
||||
BrowsingSettings()
|
||||
PlaybackSettings()
|
||||
ServicesSettings()
|
||||
|
@ -54,7 +54,6 @@ struct VerticalCells: View {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
var scrollViewShowsIndicators: Bool {
|
||||
#if !os(tvOS)
|
||||
true
|
||||
|
@ -26,6 +26,7 @@ struct YatteeApp: App {
|
||||
#if os(macOS)
|
||||
Settings {
|
||||
SettingsView()
|
||||
.environmentObject(AccountsModel())
|
||||
.environmentObject(InstancesModel())
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user