mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-11 12:26:41 +00:00
macos: setup the standard sparkle driver for no-window scenario
If there are no windows, we use the standard sparkle driver to drive the standard window-based update UI.
This commit is contained in:
@@ -18,7 +18,9 @@ class UpdateController {
|
||||
/// Initialize a new update controller.
|
||||
init() {
|
||||
let hostBundle = Bundle.main
|
||||
self.userDriver = UpdateDriver(viewModel: .init())
|
||||
self.userDriver = UpdateDriver(
|
||||
viewModel: .init(),
|
||||
hostBundle: hostBundle)
|
||||
self.updater = SPUUpdater(
|
||||
hostBundle: hostBundle,
|
||||
applicationBundle: hostBundle,
|
||||
|
@@ -4,9 +4,11 @@ import Sparkle
|
||||
/// Implement the SPUUserDriver to modify our UpdateViewModel for custom presentation.
|
||||
class UpdateDriver: NSObject, SPUUserDriver {
|
||||
let viewModel: UpdateViewModel
|
||||
let standard: SPUStandardUserDriver
|
||||
|
||||
init(viewModel: UpdateViewModel) {
|
||||
init(viewModel: UpdateViewModel, hostBundle: Bundle) {
|
||||
self.viewModel = viewModel
|
||||
self.standard = SPUStandardUserDriver(hostBundle: hostBundle, delegate: nil)
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user