Env fixes

This commit is contained in:
Max Goedjen 2025-08-14 20:00:11 -07:00
parent 3b7d0f664e
commit 4748cf8507
No known key found for this signature in database
5 changed files with 10 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import os
import Common import Common
/// A concrete implementation of ``UpdaterProtocol`` which considers the current release and OS version. /// 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? { public var update: Release? {
_update.lockedValue _update.lockedValue

View File

@ -2,12 +2,13 @@ import Foundation
import os import os
/// A protocol for retreiving the latest available version of an app. /// A protocol for retreiving the latest available version of an app.
public protocol UpdaterProtocol: Observable { public protocol UpdaterProtocol: Observable, Sendable {
/// The latest update /// The latest update
var update: Release? { get } 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) /// 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 } var testBuild: Bool { get }
func ignore(release: Release) async
} }

View File

@ -3,7 +3,7 @@ import os
import Observation import Observation
import Brief import Brief
@Observable class PreviewUpdater: UpdaterProtocol { @Observable final class PreviewUpdater: UpdaterProtocol {
var update: Release? { var update: Release? {
_update.lockedValue _update.lockedValue
@ -23,6 +23,9 @@ import Brief
} }
} }
func ignore(release: Release) async {
}
} }
extension PreviewUpdater { extension PreviewUpdater {

View File

@ -6,7 +6,7 @@ struct StoreListView: View {
@Binding var activeSecret: AnySecret? @Binding var activeSecret: AnySecret?
@Environment(SecretStoreList.self) private var storeList: SecretStoreList @Environment(\.secretStoreList) private var storeList: SecretStoreList
private func secretDeleted(secret: AnySecret) { private func secretDeleted(secret: AnySecret) {
activeSecret = nextDefaultSecret activeSecret = nextDefaultSecret

View File

@ -1,9 +1,9 @@
import SwiftUI import SwiftUI
import Brief import Brief
struct UpdateDetailView<UpdaterType: Updater>: View { struct UpdateDetailView: View {
@Environment(UpdaterType.self) var updater: UpdaterType @Environment(\.updater) var updater: any UpdaterProtocol
let update: Release let update: Release