2017-09-27 02:42:18 +08:00
|
|
|
import { WorkspaceStore, ComponentRegistry, Actions } from 'mailspring-exports';
|
2017-09-27 02:33:08 +08:00
|
|
|
import DraftList from './draft-list';
|
|
|
|
import DraftListToolbar from './draft-list-toolbar';
|
|
|
|
import DraftListSendStatus from './draft-list-send-status';
|
|
|
|
import { DraftDeleteButton } from './draft-toolbar-buttons';
|
2016-03-18 00:50:30 +08:00
|
|
|
|
|
|
|
export function activate() {
|
2017-09-27 02:33:08 +08:00
|
|
|
WorkspaceStore.defineSheet('Drafts', { root: true }, { list: ['RootSidebar', 'DraftList'] });
|
|
|
|
if (
|
2017-09-27 02:36:58 +08:00
|
|
|
AppEnv.savedState.perspective &&
|
|
|
|
AppEnv.savedState.perspective.type === 'DraftsMailboxPerspective'
|
2017-09-27 02:33:08 +08:00
|
|
|
) {
|
2016-04-23 08:30:14 +08:00
|
|
|
Actions.selectRootSheet(WorkspaceStore.Sheet.Drafts);
|
|
|
|
}
|
2016-03-18 00:50:30 +08:00
|
|
|
|
2017-09-27 02:33:08 +08:00
|
|
|
ComponentRegistry.register(DraftList, { location: WorkspaceStore.Location.DraftList });
|
|
|
|
ComponentRegistry.register(DraftListToolbar, {
|
|
|
|
location: WorkspaceStore.Location.DraftList.Toolbar,
|
|
|
|
});
|
|
|
|
ComponentRegistry.register(DraftDeleteButton, { role: 'DraftActionsToolbarButton' });
|
|
|
|
ComponentRegistry.register(DraftListSendStatus, { role: 'DraftList:DraftStatus' });
|
2016-03-18 00:50:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function deactivate() {
|
2017-09-27 02:33:08 +08:00
|
|
|
ComponentRegistry.unregister(DraftList);
|
|
|
|
ComponentRegistry.unregister(DraftListToolbar);
|
|
|
|
ComponentRegistry.unregister(DraftDeleteButton);
|
|
|
|
ComponentRegistry.unregister(DraftListSendStatus);
|
2016-03-18 00:50:30 +08:00
|
|
|
}
|