From 3aef7d4d936eaaa93ad482c4aee097c11b06a367 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 17 Jun 2020 17:38:00 -0400 Subject: [PATCH] Organize Preferences.swift --- Tusker/Preferences/Preferences.swift | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Tusker/Preferences/Preferences.swift b/Tusker/Preferences/Preferences.swift index 285b697025..3543ee449d 100644 --- a/Tusker/Preferences/Preferences.swift +++ b/Tusker/Preferences/Preferences.swift @@ -47,8 +47,10 @@ class Preferences: Codable, ObservableObject { self.requireAttachmentDescriptions = try container.decode(Bool.self, forKey: .requireAttachmentDescriptions) self.contentWarningCopyMode = try container.decode(ContentWarningCopyMode.self, forKey: .contentWarningCopyMode) self.mentionReblogger = try container.decode(Bool.self, forKey: .mentionReblogger) + self.blurAllMedia = try container.decode(Bool.self, forKey: .blurAllMedia) self.automaticallyPlayGifs = try container.decode(Bool.self, forKey: .automaticallyPlayGifs) + self.openLinksInApps = try container.decode(Bool.self, forKey: .openLinksInApps) self.useInAppSafari = try container.decode(Bool.self, forKey: .useInAppSafari) self.inAppSafariAutomaticReaderMode = try container.decode(Bool.self, forKey: .inAppSafariAutomaticReaderMode) @@ -73,8 +75,10 @@ class Preferences: Codable, ObservableObject { try container.encode(requireAttachmentDescriptions, forKey: .requireAttachmentDescriptions) try container.encode(contentWarningCopyMode, forKey: .contentWarningCopyMode) try container.encode(mentionReblogger, forKey: .mentionReblogger) + try container.encode(blurAllMedia, forKey: .blurAllMedia) try container.encode(automaticallyPlayGifs, forKey: .automaticallyPlayGifs) + try container.encode(openLinksInApps, forKey: .openLinksInApps) try container.encode(useInAppSafari, forKey: .useInAppSafari) try container.encode(inAppSafariAutomaticReaderMode, forKey: .inAppSafariAutomaticReaderMode) @@ -86,29 +90,33 @@ class Preferences: Codable, ObservableObject { try container.encode(statusContentType, forKey: .statusContentType) } - // MARK: - Appearance + // MARK: Appearance @Published var theme = UIUserInterfaceStyle.unspecified @Published var showRepliesInProfiles = false @Published var avatarStyle = AvatarStyle.roundRect @Published var hideCustomEmojiInUsernames = false - // MARK: - Behavior + // MARK: Composing @Published var defaultPostVisibility = Status.Visibility.public @Published var automaticallySaveDrafts = true @Published var requireAttachmentDescriptions = false @Published var contentWarningCopyMode = ContentWarningCopyMode.asIs @Published var mentionReblogger = false + + // MARK: Media @Published var blurAllMedia = false @Published var automaticallyPlayGifs = true + + // MARK: Behavior @Published var openLinksInApps = true @Published var useInAppSafari = true @Published var inAppSafariAutomaticReaderMode = false - // MARK: - Digital Wellness + // MARK: Digital Wellness @Published var showFavoriteAndReblogCounts = true @Published var defaultNotificationsMode = NotificationsMode.allNotifications - // MARK: - Advanced + // MARK: Advanced @Published var silentActions: [String: Permission] = [:] @Published var statusContentType: StatusContentType = .plain @@ -123,8 +131,10 @@ class Preferences: Codable, ObservableObject { case requireAttachmentDescriptions case contentWarningCopyMode case mentionReblogger + case blurAllMedia case automaticallyPlayGifs + case openLinksInApps case useInAppSafari case inAppSafariAutomaticReaderMode