Automattic / simplenote-electron

Simplenote for Web, Windows, and Linux
https://app.simplenote.com
GNU General Public License v2.0
4.69k stars 553 forks source link

Fix: Disable the menu item to check for updates if the updater won't check #3214

Closed codebykat closed 1 week ago

codebykat commented 3 weeks ago

Fix

If you "check for updates" on a non-packaged version of the app, it will immediately resolve the promise to null and log the message "Skip checkForUpdates because application is not packed and dev update config is not forced". However the current progress bar doesn't get an onError callback from that so it hangs indefinitely.

This PR uses the same function the updater uses to disable the option to check for updates if it won't work anyway.

Fixes #3213 (the underlying problem isn't what I initially thought it was)

Test

  1. On a packaged version of the app (see build artifacts), you should be able to check for updates from the menu
  2. On a development version (e.g. from npm run dev), the menu option should be grayed out

Release

Disable the menu item to check for updates in the development environment