secretive/Sources/Secretive/Preview Content/PreviewUpdater.swift
Max Goedjen 902d5c4a1e
Nightly display version (#670)
* Link to nightly and parse version better

* Add nightly date.
2025-09-04 07:19:55 +00:00

34 lines
825 B
Swift

import Foundation
import Observation
import Brief
@Observable @MainActor final class PreviewUpdater: UpdaterProtocol {
var update: Release? = nil
let currentVersion = SemVer("0.0.0_preview")
init(update: Update = .none) {
switch update {
case .none:
self.update = nil
case .advisory:
self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Some regular update")
case .critical:
self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update")
}
}
func ignore(release: Release) async {
}
}
extension PreviewUpdater {
enum Update {
case none, advisory, critical
}
}