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

☠☕ Decaffeinate src/theme-package.coffee #16018

Merged
merged 1 commit into from
Oct 31, 2017
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
37 changes: 0 additions & 37 deletions src/theme-package.coffee

This file was deleted.

55 changes: 55 additions & 0 deletions src/theme-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const path = require('path')
const Package = require('./package')

module.exports =
class ThemePackage extends Package {
getType () {
return 'theme'
}

getStyleSheetPriority () {
return 1
}

enable () {
this.config.unshiftAtKeyPath('core.themes', this.name)
}

disable () {
this.config.removeAtKeyPath('core.themes', this.name)
}

preload () {
this.loadTime = 0
this.configSchemaRegisteredOnLoad = this.registerConfigSchemaFromMetadata()
}

finishLoading () {
this.path = path.join(this.packageManager.resourcePath, this.path)
}

load () {
this.loadTime = 0
this.configSchemaRegisteredOnLoad = this.registerConfigSchemaFromMetadata()
return this
}

activate () {
if (this.activationPromise == null) {
this.activationPromise = new Promise((resolve, reject) => {
this.resolveActivationPromise = resolve
this.rejectActivationPromise = reject
this.measure('activateTime', () => {
try {
this.loadStylesheets()
this.activateNow()
} catch (error) {
this.handleError(`Failed to activate the ${this.name} theme`, error)
}
})
})
}

return this.activationPromise
}
}