diff --git a/Sources/Packages/Sources/Brief/Updater.swift b/Sources/Packages/Sources/Brief/Updater.swift index ded9996..0b30327 100644 --- a/Sources/Packages/Sources/Brief/Updater.swift +++ b/Sources/Packages/Sources/Brief/Updater.swift @@ -4,7 +4,7 @@ import os import Common /// A concrete implementation of ``UpdaterProtocol`` which considers the current release and OS version. -@Observable public final class Updater: UpdaterProtocol, ObservableObject, Sendable { +@Observable public final class Updater: UpdaterProtocol, Sendable { public var update: Release? { _update.lockedValue diff --git a/Sources/Packages/Sources/Brief/UpdaterProtocol.swift b/Sources/Packages/Sources/Brief/UpdaterProtocol.swift index fcfd3bd..04f96d7 100644 --- a/Sources/Packages/Sources/Brief/UpdaterProtocol.swift +++ b/Sources/Packages/Sources/Brief/UpdaterProtocol.swift @@ -2,12 +2,13 @@ import Foundation import os /// A protocol for retreiving the latest available version of an app. -public protocol UpdaterProtocol: Observable { +public protocol UpdaterProtocol: Observable, Sendable { /// The latest update var update: Release? { get } /// A boolean describing whether or not the current build of the app is a "test" build (ie, a debug build or otherwise special build) var testBuild: Bool { get } + func ignore(release: Release) async } diff --git a/Sources/Secretive/Preview Content/PreviewUpdater.swift b/Sources/Secretive/Preview Content/PreviewUpdater.swift index 5ad2585..b246c78 100644 --- a/Sources/Secretive/Preview Content/PreviewUpdater.swift +++ b/Sources/Secretive/Preview Content/PreviewUpdater.swift @@ -3,7 +3,7 @@ import os import Observation import Brief -@Observable class PreviewUpdater: UpdaterProtocol { +@Observable final class PreviewUpdater: UpdaterProtocol { var update: Release? { _update.lockedValue @@ -23,6 +23,9 @@ import Brief } } + func ignore(release: Release) async { + } + } extension PreviewUpdater { diff --git a/Sources/Secretive/Views/StoreListView.swift b/Sources/Secretive/Views/StoreListView.swift index 7ffe0ee..4e2dced 100644 --- a/Sources/Secretive/Views/StoreListView.swift +++ b/Sources/Secretive/Views/StoreListView.swift @@ -6,7 +6,7 @@ struct StoreListView: View { @Binding var activeSecret: AnySecret? - @Environment(SecretStoreList.self) private var storeList: SecretStoreList + @Environment(\.secretStoreList) private var storeList: SecretStoreList private func secretDeleted(secret: AnySecret) { activeSecret = nextDefaultSecret diff --git a/Sources/Secretive/Views/UpdateView.swift b/Sources/Secretive/Views/UpdateView.swift index ae63649..bebbcc5 100644 --- a/Sources/Secretive/Views/UpdateView.swift +++ b/Sources/Secretive/Views/UpdateView.swift @@ -1,9 +1,9 @@ import SwiftUI import Brief -struct UpdateDetailView: View { +struct UpdateDetailView: View { - @Environment(UpdaterType.self) var updater: UpdaterType + @Environment(\.updater) var updater: any UpdaterProtocol let update: Release