mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-20 03:10:57 +00:00
Env fixes
This commit is contained in:
parent
3b7d0f664e
commit
4748cf8507
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -1,9 +1,9 @@
|
||||
import SwiftUI
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user