From c22e7d9ed803cba9c124a6d82ef008ffb01d5f5b Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Thu, 14 Aug 2025 20:20:40 -0700 Subject: [PATCH] Cleanup --- Sources/Secretive/Controllers/JustUpdatedChecker.swift | 6 +++--- Sources/Secretive/Preview Content/PreviewStore.swift | 2 +- Sources/Secretive/Views/CreateSecretView.swift | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Secretive/Controllers/JustUpdatedChecker.swift b/Sources/Secretive/Controllers/JustUpdatedChecker.swift index 4c86f68..4e8ea72 100644 --- a/Sources/Secretive/Controllers/JustUpdatedChecker.swift +++ b/Sources/Secretive/Controllers/JustUpdatedChecker.swift @@ -2,13 +2,13 @@ import Foundation import Combine import AppKit -protocol JustUpdatedCheckerProtocol: ObservableObject { +protocol JustUpdatedCheckerProtocol: Observable { var justUpdated: Bool { get } } -class JustUpdatedChecker: ObservableObject, JustUpdatedCheckerProtocol { +@Observable class JustUpdatedChecker: JustUpdatedCheckerProtocol { - @Published var justUpdated: Bool = false + var justUpdated: Bool = false init() { check() diff --git a/Sources/Secretive/Preview Content/PreviewStore.swift b/Sources/Secretive/Preview Content/PreviewStore.swift index c3b02a3..8318505 100644 --- a/Sources/Secretive/Preview Content/PreviewStore.swift +++ b/Sources/Secretive/Preview Content/PreviewStore.swift @@ -20,7 +20,7 @@ extension Preview { extension Preview { - final class Store: SecretStore, ObservableObject { + @Observable final class Store: SecretStore { let isAvailable = true let id = UUID() diff --git a/Sources/Secretive/Views/CreateSecretView.swift b/Sources/Secretive/Views/CreateSecretView.swift index 3dcc20d..9bddcd2 100644 --- a/Sources/Secretive/Views/CreateSecretView.swift +++ b/Sources/Secretive/Views/CreateSecretView.swift @@ -112,10 +112,10 @@ extension ThumbnailPickerView { } -@MainActor class SystemBackground: ObservableObject { +@MainActor @Observable class SystemBackground { static let shared = SystemBackground() - @Published var image: NSImage? + var image: NSImage? private init() { if let mainScreen = NSScreen.main, let imageURL = NSWorkspace.shared.desktopImageURL(for: mainScreen) {