secretive/Sources/Secretive/Preview Content/PreviewUpdater.swift

30 lines
715 B
Swift
Raw Permalink Normal View History

2020-03-15 08:01:40 +00:00
import Foundation
import Combine
2020-03-22 01:43:26 +00:00
import Brief
2020-03-15 08:01:40 +00:00
2022-02-12 07:31:03 +00:00
class PreviewUpdater: UpdateCheckerProtocol {
2020-03-15 08:01:40 +00:00
let update: Release?
let testBuild = false
2020-03-15 08:01:40 +00:00
init(update: Update = .none) {
switch update {
case .none:
self.update = nil
case .advisory:
2020-09-22 06:12:50 +00:00
self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Some regular update")
2020-03-15 08:01:40 +00:00
case .critical:
2020-09-22 06:12:50 +00:00
self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update")
2020-03-15 08:01:40 +00:00
}
}
}
extension PreviewUpdater {
enum Update {
case none, advisory, critical
}
}