Mailspring/internal_packages/open-tracking/lib/main.es6
Drew Regitsky 1bd3fc74e9 test(plugins): Add specs, refactor/fixes for open and link tracking
Summary:
Add specs to test the components of open tracking and link
tracking. Notably does not test the overall functionality, which
still needs specs.

Test Plan: adds specs

Reviewers: juan, evan, bengotow

Reviewed By: evan, bengotow

Differential Revision: https://phab.nylas.com/D2667
2016-03-07 20:54:43 -08:00

25 lines
1.2 KiB
JavaScript

import {ComponentRegistry, ExtensionRegistry, Actions} from 'nylas-exports';
import OpenTrackingButton from './open-tracking-button';
import OpenTrackingIcon from './open-tracking-icon';
import OpenTrackingMessageStatus from './open-tracking-message-status';
import OpenTrackingAfterSend from './open-tracking-after-send';
import OpenTrackingComposerExtension from './open-tracking-composer-extension';
export function activate() {
ComponentRegistry.register(OpenTrackingButton, {role: 'Composer:ActionButton'});
ComponentRegistry.register(OpenTrackingIcon, {role: 'ThreadListIcon'});
ComponentRegistry.register(OpenTrackingMessageStatus, {role: 'MessageHeaderStatus'});
ExtensionRegistry.Composer.register(OpenTrackingComposerExtension);
this._unlistenSendDraftSuccess = Actions.sendDraftSuccess.listen(OpenTrackingAfterSend.afterDraftSend);
}
export function serialize() {}
export function deactivate() {
ComponentRegistry.unregister(OpenTrackingButton);
ComponentRegistry.unregister(OpenTrackingIcon);
ComponentRegistry.unregister(OpenTrackingMessageStatus);
ExtensionRegistry.Composer.unregister(OpenTrackingComposerExtension);
this._unlistenSendDraftSuccess()
}