summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-01 13:59:52 +0000
committerFuwn <[email protected]>2026-04-01 13:59:52 +0000
commitddaa9cbfe0cc8d254d4901ad192918d91dd627d4 (patch)
treeb0d1cf6642ae97ce41ff570f2bcd4a06b359685e /Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
parentFix iOS install recipe app path resolution (diff)
downloadsora-testing-ddaa9cbfe0cc8d254d4901ad192918d91dd627d4.tar.xz
sora-testing-ddaa9cbfe0cc8d254d4901ad192918d91dd627d4.zip
Migrate settings manager to Swift Observation
Diffstat (limited to 'Sora/Views/Settings/Section/SettingsSectionSettingsView.swift')
-rw-r--r--Sora/Views/Settings/Section/SettingsSectionSettingsView.swift11
1 files changed, 8 insertions, 3 deletions
diff --git a/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift b/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
index 784ee2a..ad7fe83 100644
--- a/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
+++ b/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
@@ -1,17 +1,22 @@
import SwiftUI
struct SettingsSectionSettingsView: View {
- @EnvironmentObject var settings: SettingsManager
+ @Environment(SettingsManager.self)
+ private var settings
var body: some View {
+ @Bindable var settings = settings
+
Toggle(isOn: $settings.enableSync) {
Text("Sync with iCloud")
Text("Keep bookmarks, collections, search history, and sources in sync across your devices.")
.font(.caption)
}
- .onChange(of: settings.enableSync) { _, _ in
- settings.triggerSyncIfNeededForAll()
+ .onChange(of: settings.enableSync) { _, isEnabled in
+ if isEnabled {
+ settings.triggerSyncIfNeededForAll()
+ }
}
Button("Reset Settings") {