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

Attempt to disable notifications only if it is bundled and not already disabled #4

Merged
merged 1 commit into from
May 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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