diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index 9b2f8cc3bf..3fa4e742b1 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -5,7 +5,7 @@ class SwapPanelApi { this.event = new EventEmmitter() this.component = swapPanelComponent this.currentContent - verticalIconsComponent.event.on('showContent', (moduleName) => { + verticalIconsComponent.events.on('showContent', (moduleName) => { if (!swapPanelComponent.contents[moduleName]) return if (this.currentContent === moduleName) { this.event.emit('toggle', moduleName) diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index ff2c3d5326..e81c34c068 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -1,14 +1,14 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -const EventEmmitter = require('events') +const EventEmitter = require('events') // Component class VerticalIconComponent { constructor (name, appStore) { this.store = appStore - this.event = new EventEmmitter() + this.events = new EventEmitter() this.icons = {} this.iconKind = {} this.name = name @@ -16,28 +16,34 @@ class VerticalIconComponent { this.store.event.on('activate', (name) => { const { profile } = this.store.getOne(name) if (!profile.icon) return - if (profile.prefferedLocation === this.name || !profile.prefferedLocation) { + if (profile.location === this.name || !profile.location) { this.addIcon(profile) } }) this.store.event.on('deactivate', (name) => { - const item = this.store.getOne(name) - if (item && this.icons[name]) this.removeIcon(item.profile) + const api = this.store.getOne(name) + if (api && this.icons[name]) this.removeIcon(api.profile) }) - this.store.event.on('add', (entity) => { }) - this.store.event.on('remove', (entity) => { }) + this.store.event.on('add', (api) => { }) + this.store.event.on('remove', (api) => { }) } - addIcon (mod) { - let kind = mod.kind || 'other' - this.icons[mod.name] = yo`