diff --git a/lib/main.js b/lib/main.js index 3d8c40f7..e509f547 100644 --- a/lib/main.js +++ b/lib/main.js @@ -3,8 +3,6 @@ let settingsView = null let statusView = null -const {CompositeDisposable} = require('atom') - const PackageManager = require('./package-manager') let packageManager = null @@ -44,9 +42,7 @@ module.exports = { }, activate() { - this.disposables = new CompositeDisposable() - - this.disposables.add(atom.workspace.addOpener(uri => { + atom.workspace.addOpener(uri => { if (uri.startsWith(CONFIG_URI)) { if (settingsView == null || settingsView.destroyed) { settingsView = this.createSettingsView({uri}) @@ -60,9 +56,9 @@ module.exports = { } return settingsView } - })) + }) - this.disposables.add(atom.commands.add('atom-workspace', { + atom.commands.add('atom-workspace', { 'settings-view:open'() { atom.workspace.open(CONFIG_URI) }, 'settings-view:core'() { atom.workspace.open(`${CONFIG_URI}/core`) }, 'settings-view:editor'() { atom.workspace.open(`${CONFIG_URI}/editor`) }, @@ -74,10 +70,10 @@ module.exports = { 'settings-view:view-installed-packages'() { atom.workspace.open(`${CONFIG_URI}/packages`) }, 'settings-view:uninstall-packages'() { atom.workspace.open(`${CONFIG_URI}/packages`) }, 'settings-view:check-for-package-updates'() { atom.workspace.open(`${CONFIG_URI}/updates`) } - })) + }) if (process.platform === 'win32' && require('atom').WinShell != null) { - this.disposables.add(atom.commands.add('atom-workspace', {'settings-view:system'() { atom.workspace.open(`${CONFIG_URI}/system`) }})) + atom.commands.add('atom-workspace', {'settings-view:system'() { atom.workspace.open(`${CONFIG_URI}/system`) }}) } if (!localStorage.getItem('hasSeenDeprecatedNotification')) { @@ -89,11 +85,8 @@ module.exports = { }, deactivate() { - if (this.disposables) this.disposables.dispose() if (settingsView) settingsView.destroy() - if (packageManager) packageManager.destroy() if (statusView) statusView.destroy() - this.disposables = null settingsView = null packageManager = null statusView = null diff --git a/lib/package-manager.coffee b/lib/package-manager.coffee index d33a9cb7..1a717bbf 100644 --- a/lib/package-manager.coffee +++ b/lib/package-manager.coffee @@ -18,9 +18,6 @@ class PackageManager @emitter = new Emitter - destroy: -> - @emitter.dispose() - getClient: -> @client ?= new Client(this)