summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views/Settings/Section/SettingsSectionSettingsView.swift')
-rw-r--r--Sora/Views/Settings/Section/SettingsSectionSettingsView.swift15
1 files changed, 10 insertions, 5 deletions
diff --git a/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift b/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
index 273cc82..ad7fe83 100644
--- a/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
+++ b/Sora/Views/Settings/Section/SettingsSectionSettingsView.swift
@@ -1,20 +1,25 @@
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, search history, and providers consistent across all your devices.")
+ 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 to Defaults") {
+ Button("Reset Settings") {
settings.resetToDefaults()
}
.trailingFrame()