Skip to content

Commit 6877cf1

Browse files
committed
Merge branch 'hotfix/fix-auto-check-update-toggle-not-updating'
2 parents abe0f52 + 8fcc1d2 commit 6877cf1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Core/Sources/HostApp/GeneralView.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,20 @@ struct GeneralSettingsView: View {
244244

245245
@StateObject var settings = Settings()
246246
@Environment(\.updateChecker) var updateChecker
247-
247+
@State var automaticallyCheckForUpdate: Bool?
248+
248249
var body: some View {
249250
Form {
250251
Toggle(isOn: $settings.quitXPCServiceOnXcodeAndAppQuit) {
251252
Text("Quit service when Xcode and host app are terminated")
252253
}
253254

254255
Toggle(isOn: .init(
255-
get: { updateChecker.automaticallyChecksForUpdates },
256-
set: { updateChecker.automaticallyChecksForUpdates = $0 }
256+
get: { automaticallyCheckForUpdate ?? updateChecker.automaticallyChecksForUpdates },
257+
set: {
258+
updateChecker.automaticallyChecksForUpdates = $0
259+
automaticallyCheckForUpdate = $0
260+
}
257261
)) {
258262
Text("Automatically Check for Update")
259263
}

0 commit comments

Comments
 (0)