-
Notifications
You must be signed in to change notification settings - Fork 3
feat: support disabling the built-in updater #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,18 +19,25 @@ struct GeneralTab: View { | |||||
Text("Start Coder Connect on launch") | ||||||
} | ||||||
} | ||||||
Section { | ||||||
Toggle(isOn: $updater.autoCheckForUpdates) { | ||||||
Text("Automatically check for updates") | ||||||
} | ||||||
Picker("Update channel", selection: $updater.updateChannel) { | ||||||
ForEach(UpdateChannel.allCases) { channel in | ||||||
Text(channel.name).tag(channel) | ||||||
if !updater.disabled { | ||||||
ethanndickson marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Section { | ||||||
Toggle(isOn: $updater.autoCheckForUpdates) { | ||||||
Text("Automatically check for updates") | ||||||
} | ||||||
Picker("Update channel", selection: $updater.updateChannel) { | ||||||
ForEach(UpdateChannel.allCases) { channel in | ||||||
Text(channel.name).tag(channel) | ||||||
} | ||||||
} | ||||||
HStack { | ||||||
Spacer() | ||||||
Button("Check for updates") { updater.checkForUpdates() }.disabled(!updater.canCheckForUpdates) | ||||||
} | ||||||
} | ||||||
HStack { | ||||||
Spacer() | ||||||
Button("Check for updates") { updater.checkForUpdates() }.disabled(!updater.canCheckForUpdates) | ||||||
} else { | ||||||
Section { | ||||||
Text("The app updater has been disabled by a device management policy.") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The error message assumes the updater was disabled by device management policy, but the UserDefaults key could be set by other means. Consider making the message more generic like 'The app updater has been disabled.' or 'Automatic updates are not available.'
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
.foregroundColor(.secondary) | ||||||
} | ||||||
} | ||||||
}.formStyle(.grouped) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UserDefaults.bool(forKey:) method returns false when the key doesn't exist, which means the updater will be enabled by default. However, the comment suggests the intent is to disable the updater when the key is set to true. This logic appears inverted - consider using
!UserDefaults.standard.bool(forKey: Keys.disableUpdater)
if you want the updater enabled by default.Copilot uses AI. Check for mistakes.