-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
new(ui/electron): allow updater disableing #853
Conversation
it's redundant since electron store can do what we need just fine
WalkthroughThe recent update introduces a significant enhancement to the update mechanism within an Electron application, incorporating a manual update option alongside the existing automatic updates. It involves renaming and adjusting properties and methods related to the updater, adding a new Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (3)
i18n/locales/en-US.json
is excluded by:!**/*.json
package.json
is excluded by:!**/*.json
pnpm-lock.yaml
is excluded by:!**/*.yaml
Files selected for processing (13)
- electron/main/autoUpdater.ts (3 hunks)
- electron/main/background.ts (3 hunks)
- electron/main/ipcEvents.ts (3 hunks)
- electron/main/manualUpdater.ts (1 hunks)
- electron/main/store.ts (1 hunks)
- eslint.config.js (1 hunks)
- shared/constants/events.ts (1 hunks)
- shared/constants/store.ts (1 hunks)
- shared/types/store.ts (1 hunks)
- src/App.vue (2 hunks)
- src/app.ts (2 hunks)
- src/components/header/Buttons.vue (2 hunks)
- src/components/settings/General.vue (5 hunks)
Files skipped from review due to trivial changes (3)
- shared/constants/events.ts
- shared/constants/store.ts
- src/app.ts
Additional comments: 14
eslint.config.js (1)
- 14-14: The addition of
'no-new': 'off'
to the ESLint configuration disables warnings for using thenew
keyword without storing the result. While this can accommodate certain design patterns, especially those seen in this PR withManualUpdater
andAutoUpdater
, it's crucial to use this practice judiciously to avoid potential memory leaks or unclear code. Ensure that objects instantiated in this manner are managed appropriately.src/components/header/Buttons.vue (2)
- 5-5: Removing
store
from props and relying on alternative state management approaches can enhance component reusability and maintainability. Ensure that the necessary state is still accessible to this component, possibly through global state management or context providers.- 16-16: Updating the
@click
event handler to use$emit
aligns with Vue 3's Composition API best practices. This change enhances the component's compatibility with Vue 3 and its overall maintainability.shared/types/store.ts (1)
- 43-43: Adding the
disableAutoUpdates
boolean property to theUpdater
interface aligns with the PR's objective of providing users with the option to disable automatic updates. Ensure that this property is correctly utilized throughout the application to respect the user's preferences.electron/main/ipcEvents.ts (4)
- 11-11: The import of
ManualUpdater
is correctly done, ensuring that the new functionality for manual updates can be integrated into theIpcEvents
class.- 17-17: Adding the
manualUpdater
property to theIpcEvents
class is a good practice for encapsulating the functionality related to manual updates. This allows for a clean separation of concerns.- 35-37: The
registerManualUpdater
method is well-implemented, providing a clear and straightforward way to associate aManualUpdater
instance with theIpcEvents
class. This is crucial for enabling manual update functionality based on user settings.- 168-170: The integration of
ManualUpdater
within theopenSettings
method is correctly done, ensuring that the settings window can interact with the manual update process. This is an essential part of providing a seamless user experience for managing updates.src/components/settings/General.vue (6)
- 22-23: The addition of
disableAutoUpdates
andupdaterStatus
variables is a crucial step in enabling users to control the auto-update functionality from the UI. This aligns with the PR's objective of enhancing user control over the application's update process.- 34-36: The
saveKeybind
function is correctly implemented, providing a way to save the keybind settings and notify the main process. This is important for ensuring that keybind changes are applied immediately.- 39-41: The
checkForUpdates
function is well-implemented, initiating the update check process. This function is essential for allowing users to manually check for updates when auto-updates are disabled.- 44-45: The
restart
function is correctly implemented, providing a way to restart the application. This is necessary for applying updates that have been downloaded.- 110-110: The change event handler for the
participateInPreRelease
checkbox is correctly updated to reflect the user's choice regarding beta updates. This is an important aspect of providing users with control over the update channels.- 119-163: The addition of the auto-update settings section in the template, including the UI elements for disabling auto-updates and manually checking for updates, is well-implemented. This provides users with a clear and intuitive interface for managing update preferences.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- electron/main/store.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- electron/main/store.ts
Summary by CodeRabbit