Mailspring/internal_packages/message-list/lib/main.cjsx
Ben Gotow 42ad243824 fix(message-sidebar): New ContactCard injectable role, updated FocusedContactStore
- The FocusedContactStore was triggering too often, and leaving it up to the FullcontactStore to fetch the full Contact model for the focused contact (pulled from thread.)

The FocusedContactStore triggers more responsibly, and registering for the role "MessageListSidebar:ContactCard" now gives you the focused contact as a full database model. The whole ContactCard region also fades in and out.
2015-09-24 18:58:53 -07:00

60 lines
2.2 KiB
CoffeeScript

MessageList = require "./message-list"
MessageToolbarItems = require "./message-toolbar-items"
{ComponentRegistry,
MessageStore,
WorkspaceStore} = require 'nylas-exports'
{SidebarContactCard,
SidebarSpacer,
SidebarContactList} = require "./sidebar-components"
ThreadStarButton = require './thread-star-button'
ThreadArchiveButton = require './thread-archive-button'
ThreadToggleUnreadButton = require './thread-toggle-unread-button'
AutolinkerExtension = require './plugins/autolinker-extension'
TrackingPixelsExtension = require './plugins/tracking-pixels-extension'
module.exports =
item: null # The DOM item the main React component renders into
activate: (@state={}) ->
# Register Message List Actions we provide globally
ComponentRegistry.register MessageList,
location: WorkspaceStore.Location.MessageList
ComponentRegistry.register MessageToolbarItems,
location: WorkspaceStore.Location.MessageList.Toolbar
ComponentRegistry.register SidebarContactCard,
location: WorkspaceStore.Location.MessageListSidebar
ComponentRegistry.register SidebarSpacer,
location: WorkspaceStore.Location.MessageListSidebar
ComponentRegistry.register SidebarContactList,
location: WorkspaceStore.Location.MessageListSidebar
ComponentRegistry.register ThreadStarButton,
role: 'message:Toolbar'
ComponentRegistry.register ThreadArchiveButton,
role: 'message:Toolbar'
ComponentRegistry.register ThreadToggleUnreadButton,
role: 'message:Toolbar'
MessageStore.registerExtension(AutolinkerExtension)
MessageStore.registerExtension(TrackingPixelsExtension)
deactivate: ->
ComponentRegistry.unregister MessageList
ComponentRegistry.unregister ThreadStarButton
ComponentRegistry.unregister ThreadArchiveButton
ComponentRegistry.unregister ThreadToggleUnreadButton
ComponentRegistry.unregister MessageToolbarItems
ComponentRegistry.unregister SidebarContactCard
ComponentRegistry.unregister SidebarSpacer
ComponentRegistry.unregister SidebarContactList
MessageStore.unregisterExtension(AutolinkerExtension)
MessageStore.unregisterExtension(TrackingPixelsExtension)
serialize: -> @state