summaryrefslogtreecommitdiff
path: root/Sora/Data/Settings.swift
blob: 1d3ccbae48d4bbf36d0efc2378622717669248a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import SwiftUI

class Settings: ObservableObject {
    #if DEBUG
        @AppStorage("detailViewType") var detailViewType: PostFileType = .compressed
    #else
        @AppStorage("detailViewType") var detailViewType: PostFileType = .original
    #endif
    @AppStorage("thumbnailType") var thumbnailType: PostFileType = .preview
    @AppStorage("searchSuggestions") var searchSuggestions: Bool = false
    @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
    }
}