diff --git a/internal_packages/theme-picker/lib/main.js b/internal_packages/theme-picker/lib/main.js
index 8d4da1eee..b8fa94228 100644
--- a/internal_packages/theme-picker/lib/main.js
+++ b/internal_packages/theme-picker/lib/main.js
@@ -1,23 +1,10 @@
/** @babel */
-import React from 'react';
-import Actions from '../../../src/flux/actions';
-
-import ThemePicker from './theme-picker';
import ThemePickerStore from './theme-picker-store';
-
export function activate() {
ThemePickerStore.activate();
- this.disposable = NylasEnv.commands.add("body", "window:launch-theme-picker", () => {
- Actions.openModal(
- children=,
- height=400,
- width=250,
- );
- });
}
export function deactivate() {
ThemePickerStore.deactivate();
- this.disposable.dispose();
}
diff --git a/internal_packages/theme-picker/lib/theme-picker-store.jsx b/internal_packages/theme-picker/lib/theme-picker-store.jsx
index c6ad66941..715299f48 100644
--- a/internal_packages/theme-picker/lib/theme-picker-store.jsx
+++ b/internal_packages/theme-picker/lib/theme-picker-store.jsx
@@ -1,6 +1,9 @@
+import React from 'react';
+import Actions from '../../../src/flux/actions';
import NylasStore from 'nylas-store';
import {APMWrapper} from 'nylas-exports';
+import ThemePicker from './theme-picker';
import ThemePickerActions from './theme-picker-actions';
@@ -8,11 +11,18 @@ class ThemePickerStore extends NylasStore {
constructor() {
super();
- this._apm = new APMWrapper();
}
activate = ()=> {
+ this._apm = new APMWrapper();
this.unlisten = ThemePickerActions.uninstallTheme.listen(this.uninstallTheme);
+ this.disposable = NylasEnv.commands.add("body", "window:launch-theme-picker", () => {
+ Actions.openModal(
+ children=,
+ height=400,
+ width=250,
+ );
+ });
}
uninstallTheme = (theme)=> {
@@ -25,6 +35,7 @@ class ThemePickerStore extends NylasStore {
deactivate = ()=> {
this.unlisten();
+ this.disposable.dispose();
}
}