chore: adiciona .gitignore e commit.command

This commit is contained in:
João Henrique
2026-08-18 08:25:29 -04:00
parent 68958fde00
commit 8fca456ceb
215 changed files with 65752 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import Combine
import ComposableArchitecture
import Inject
import Sparkle
import SwiftUI
@Observable
@MainActor
final class CheckForUpdatesViewModel {
init() {
anyCancellable = controller.updater.publisher(for: \.canCheckForUpdates)
.sink(receiveValue: { self.canCheckForUpdates = $0 })
}
static let shared = CheckForUpdatesViewModel()
let controller = SPUStandardUpdaterController(
startingUpdater: true,
updaterDelegate: nil,
userDriverDelegate: nil
)
var anyCancellable: AnyCancellable?
var canCheckForUpdates = false
func checkForUpdates() {
controller.updater.checkForUpdates()
}
}
struct CheckForUpdatesView: View {
@State var viewModel = CheckForUpdatesViewModel.shared
@ObserveInjection var inject
var body: some View {
Button("Check for Updates…", action: viewModel.checkForUpdates)
.disabled(!viewModel.canCheckForUpdates)
.enableInjection()
}
}