Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 04248bf

Browse files
WliuWliu
authored andcommitted
Merge branch 'master' into wl-settings-validation
2 parents 64492ca + 594c12f commit 04248bf

2 files changed

Lines changed: 5 additions & 15 deletions

File tree

lib/main.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ let settingsView = null
33

44
let statusView = null
55

6-
const {CompositeDisposable} = require('atom')
7-
86
const PackageManager = require('./package-manager')
97
let packageManager = null
108

@@ -44,9 +42,7 @@ module.exports = {
4442
},
4543

4644
activate() {
47-
this.disposables = new CompositeDisposable()
48-
49-
this.disposables.add(atom.workspace.addOpener(uri => {
45+
atom.workspace.addOpener(uri => {
5046
if (uri.startsWith(CONFIG_URI)) {
5147
if (settingsView == null || settingsView.destroyed) {
5248
settingsView = this.createSettingsView({uri})
@@ -60,9 +56,9 @@ module.exports = {
6056
}
6157
return settingsView
6258
}
63-
}))
59+
})
6460

65-
this.disposables.add(atom.commands.add('atom-workspace', {
61+
atom.commands.add('atom-workspace', {
6662
'settings-view:open'() { atom.workspace.open(CONFIG_URI) },
6763
'settings-view:core'() { atom.workspace.open(`${CONFIG_URI}/core`) },
6864
'settings-view:editor'() { atom.workspace.open(`${CONFIG_URI}/editor`) },
@@ -74,10 +70,10 @@ module.exports = {
7470
'settings-view:view-installed-packages'() { atom.workspace.open(`${CONFIG_URI}/packages`) },
7571
'settings-view:uninstall-packages'() { atom.workspace.open(`${CONFIG_URI}/packages`) },
7672
'settings-view:check-for-package-updates'() { atom.workspace.open(`${CONFIG_URI}/updates`) }
77-
}))
73+
})
7874

7975
if (process.platform === 'win32' && require('atom').WinShell != null) {
80-
this.disposables.add(atom.commands.add('atom-workspace', {'settings-view:system'() { atom.workspace.open(`${CONFIG_URI}/system`) }}))
76+
atom.commands.add('atom-workspace', {'settings-view:system'() { atom.workspace.open(`${CONFIG_URI}/system`) }})
8177
}
8278

8379
if (!localStorage.getItem('hasSeenDeprecatedNotification')) {
@@ -89,11 +85,8 @@ module.exports = {
8985
},
9086

9187
deactivate() {
92-
if (this.disposables) this.disposables.dispose()
9388
if (settingsView) settingsView.destroy()
94-
if (packageManager) packageManager.destroy()
9589
if (statusView) statusView.destroy()
96-
this.disposables = null
9790
settingsView = null
9891
packageManager = null
9992
statusView = null

lib/package-manager.coffee

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ class PackageManager
1818

1919
@emitter = new Emitter
2020

21-
destroy: ->
22-
@emitter.dispose()
23-
2421
getClient: ->
2522
@client ?= new Client(this)
2623

0 commit comments

Comments
 (0)