mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(theme-picker): Move launch command to activate()
This commit is contained in:
parent
f526bb2736
commit
5be8811e33
|
@ -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=<ThemePicker />,
|
||||
height=400,
|
||||
width=250,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function deactivate() {
|
||||
ThemePickerStore.deactivate();
|
||||
this.disposable.dispose();
|
||||
}
|
||||
|
|
|
@ -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=<ThemePicker />,
|
||||
height=400,
|
||||
width=250,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
uninstallTheme = (theme)=> {
|
||||
|
@ -25,6 +35,7 @@ class ThemePickerStore extends NylasStore {
|
|||
|
||||
deactivate = ()=> {
|
||||
this.unlisten();
|
||||
this.disposable.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue