diff options
| author | Fuwn <[email protected]> | 2025-02-20 05:02:06 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-20 05:02:06 -0800 |
| commit | 790689157f13eac497d6823fc373458fc63fcc6a (patch) | |
| tree | a6a6a0a161f1fe48a2c03dde69f2473e4784fb72 | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-790689157f13eac497d6823fc373458fc63fcc6a.tar.xz sora-testing-790689157f13eac497d6823fc373458fc63fcc6a.zip | |
feat: Development commit
| -rw-r--r-- | Sora/Data/Settings.swift | 13 | ||||
| -rw-r--r-- | Sora/Views/SettingsView.swift | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Sora/Data/Settings.swift b/Sora/Data/Settings.swift index 43b2a56..1d3ccba 100644 --- a/Sora/Data/Settings.swift +++ b/Sora/Data/Settings.swift @@ -11,4 +11,17 @@ class Settings: ObservableObject { @AppStorage("columns") var columns: Int = 2 @AppStorage("blurNSFWThumbnails") var blurNSFWThumbnails: Bool = true @AppStorage("showNSFWPosts") var showNSFWPosts: Bool = false + + func resetToDefaults() { + #if DEBUG + detailViewType = .compressed + #else + detailViewType = .original + #endif + thumbnailType = .preview + searchSuggestions = false + columns = 2 + blurNSFWThumbnails = true + showNSFWPosts = false + } } diff --git a/Sora/Views/SettingsView.swift b/Sora/Views/SettingsView.swift index 668d31f..c658775 100644 --- a/Sora/Views/SettingsView.swift +++ b/Sora/Views/SettingsView.swift @@ -1,6 +1,8 @@ import SwiftUI struct SettingsView: View { + @EnvironmentObject var settings: Settings + var body: some View { Form { Section(header: Text("Thumbnails")) { @@ -15,6 +17,12 @@ struct SettingsView: View { SettingsSearchView() } + Section(header: Text("Settings")) { + Button("Reset to Defaults") { + self.settings.resetToDefaults() + } + } + Section(header: Text("Attributions")) { SettingsAttributionsView() } |