mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
ef7266d362
- Remove deprecated use of DraftStoreExtension and DraftStore.register
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
import {PreferencesUIStore, ComponentRegistry, ExtensionRegistry} from 'nylas-exports';
|
|
import TemplatePicker from './template-picker';
|
|
import TemplateStatusBar from './template-status-bar';
|
|
import TemplateComposerExtension from './template-composer-extension';
|
|
|
|
module.exports = {
|
|
activate(state = {}) {
|
|
this.state = state;
|
|
this.preferencesTab = new PreferencesUIStore.TabItem({
|
|
tabId: 'Quick Replies',
|
|
displayName: 'Quick Replies',
|
|
component: require('./preferences-templates'),
|
|
});
|
|
ComponentRegistry.register(TemplatePicker, {role: 'Composer:ActionButton'});
|
|
ComponentRegistry.register(TemplateStatusBar, {role: 'Composer:Footer'});
|
|
PreferencesUIStore.registerPreferencesTab(this.preferencesTab);
|
|
ExtensionRegistry.Composer.register(TemplateComposerExtension);
|
|
},
|
|
|
|
deactivate() {
|
|
ComponentRegistry.unregister(TemplatePicker);
|
|
ComponentRegistry.unregister(TemplateStatusBar);
|
|
PreferencesUIStore.unregisterPreferencesTab(this.preferencesTab.sectionId);
|
|
ExtensionRegistry.Composer.unregister(TemplateComposerExtension);
|
|
},
|
|
|
|
serialize() { return this.state; },
|
|
};
|