-
Notifications
You must be signed in to change notification settings - Fork 277
Disable update notification for disabled packages#1005
Disable update notification for disabled packages#1005JonatanPaalsson wants to merge 3 commits intoatom:masterfrom
Conversation
Description of the Change
The purpose of this pull request is to fix the bug where a notification is given that updates are available even though the package is disabled.
This is done by looking at all the packages in the list updatesin the package-updates-status-view.jsand then temporarily remove all disabled packages from the list when calculating the number of packages that have available updates.
A event is also introduced which is triggered by enabling or disabling a package. The purpose of this is so that the user is immediately informed if the package has an available update or it let's Atom know that the user is not interested to know if updates are available for the selected package.
Alternate Designs
An alternative is the remove all the disabled packages from the list updates completely and then add them when the package is enabled. This however would lead to that the packages won't show up in the available-updates view.
Benefits
Now all disabled packages will not trigger the update status message that appears in the lower right corner. The status message will also be updated when enabling or disabling a package.
Possible Drawbacks
The function updateTilebecomes a bit more complex and also have some impact on performance depending on how many packages that are in the updates list.
Applicable Issues
Fixes #956
|
I'm having some problems writing specs for my implementation. My problem is trying to disable packages. I want to do something similar to: describe "When a package is disabled", ->
This probably fails because the package is not loaded, however I'm not sure. In a similar way I'm having problem loading this package. If anyone could help me out or point me in some direction I would be very grateful. |
| } | ||
| } | ||
| } | ||
|
|
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.
I believe that these two loops can be replaced with:
const updatesWithoutDisabled = this.updates.filter(update => !atom.packages.isPackageDisabled(update.name))
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.
Thank you, I refactored the code using filter instead of for-loops and no the specs seem to be working.