Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from learn-co/fix-disable
Browse files Browse the repository at this point in the history
Attempt to disable notifications only if it is bundled and not already disabled
  • Loading branch information
drewprice authored May 18, 2017
2 parents e4a3dae + 9706bbc commit 586e290
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ StackTraceParser = null
{app} = require 'remote'
coreAppIsAtom = app.getName().match(/atom/i)?

isBundledPackageEnabled = (name) ->
isDisabled = atom.packages.isPackageDisabled(name)
isBundled = atom.packages.isBundledPackage(name)

isBundled and not isDisabled

Notifications =
isInitialized: false
subscriptions: null
Expand All @@ -14,7 +20,7 @@ Notifications =
if coreAppIsAtom
return

if not atom.packages.isPackageDisabled('notifications')
if isBundledPackageEnabled('notifications')
atom.packages.disablePackage('notifications')
atom.restartApplication()

Expand Down

0 comments on commit 586e290

Please sign in to comment.