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

Commit

Permalink
Attempt disable only if bundled and not already disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotdrew committed May 18, 2017
1 parent e4a3dae commit 9706bbc
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 9706bbc

Please sign in to comment.