-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba1b0ec
commit 2586edb
Showing
11 changed files
with
160 additions
and
30 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// CheckForUpdatesView.swift | ||
// ModelCraft | ||
// | ||
// Created by 张鸿燊 on 11/4/2024. | ||
// | ||
|
||
import SwiftUI | ||
import Sparkle | ||
|
||
// This view model class publishes when new updates can be checked by the user | ||
final class CheckForUpdatesViewModel: ObservableObject { | ||
@Published var canCheckForUpdates = false | ||
|
||
init(updater: SPUUpdater) { | ||
updater.publisher(for: \.canCheckForUpdates) | ||
.assign(to: &$canCheckForUpdates) | ||
} | ||
} | ||
|
||
|
||
struct CheckForUpdatesView: View { | ||
@ObservedObject private var checkForUpdatesViewModel: CheckForUpdatesViewModel | ||
private let updater: SPUUpdater | ||
|
||
init(updater: SPUUpdater) { | ||
self.updater = updater | ||
|
||
// Create our view model for our CheckForUpdatesView | ||
self.checkForUpdatesViewModel = CheckForUpdatesViewModel(updater: updater) | ||
} | ||
|
||
var body: some View { | ||
Button("Check for Updates…", action: updater.checkForUpdates) | ||
.disabled(!checkForUpdatesViewModel.canCheckForUpdates) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,9 @@ | |
} | ||
} | ||
} | ||
}, | ||
"Check for Updates…" : { | ||
|
||
}, | ||
"Choose a model to chat" : { | ||
"extractionState" : "stale", | ||
|
Oops, something went wrong.