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

Revert "Deactivate correctly" #1035

Merged
merged 1 commit into from
Jan 3, 2018
Merged
Show file tree
Hide file tree
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
17 changes: 5 additions & 12 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ let settingsView = null

let statusView = null

const {CompositeDisposable} = require('atom')

const PackageManager = require('./package-manager')
let packageManager = null

Expand Down Expand Up @@ -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})
Expand All @@ -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`) },
Expand All @@ -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')) {
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions lib/package-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class PackageManager

@emitter = new Emitter

destroy: ->
@emitter.dispose()

getClient: ->
@client ?= new Client(this)

Expand Down