mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-04 07:10:06 +08:00
29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
import { WorkspaceStore, ComponentRegistry, Actions } from 'mailspring-exports';
|
|
import DraftList from './draft-list';
|
|
import DraftListToolbar from './draft-list-toolbar';
|
|
import DraftListSendStatus from './draft-list-send-status';
|
|
import { DraftDeleteButton } from './draft-toolbar-buttons';
|
|
|
|
export function activate() {
|
|
WorkspaceStore.defineSheet('Drafts', { root: true }, { list: ['RootSidebar', 'DraftList'] });
|
|
if (
|
|
AppEnv.savedState.perspective &&
|
|
AppEnv.savedState.perspective.type === 'DraftsMailboxPerspective'
|
|
) {
|
|
Actions.selectRootSheet(WorkspaceStore.Sheet.Drafts);
|
|
}
|
|
|
|
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' });
|
|
}
|
|
|
|
export function deactivate() {
|
|
ComponentRegistry.unregister(DraftList);
|
|
ComponentRegistry.unregister(DraftListToolbar);
|
|
ComponentRegistry.unregister(DraftDeleteButton);
|
|
ComponentRegistry.unregister(DraftListSendStatus);
|
|
}
|