mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-19 22:50:13 +08:00
a31c2808a9
Summary: There were several issues causing uploading to not work: # The file upload response came back as a string instead of an Object. Needed to detect and `JSON.parse` # The `MessageAttachment` component was not available as a package on the popout composer (since it used to be inside of `MessageList`) # The `message.draft` bit was not set properly causing the DB changes to be ignored # The actions notifying of `uploadStateChanged` were only being broadcasted in the main window (where the `TaskStore` is) and never making it to the popout composer. Also keybindings for close window and up & down arrows were fixed. Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://review.inboxapp.com/D1157
51 lines
1.5 KiB
CoffeeScript
51 lines
1.5 KiB
CoffeeScript
React = require "react"
|
|
MessageList = require "./message-list"
|
|
{ComponentRegistry} = require 'inbox-exports'
|
|
|
|
{ReplyButton,
|
|
ReplyAllButton,
|
|
ForwardButton,
|
|
ArchiveButton} = require "./core-primary-actions.cjsx"
|
|
|
|
module.exports =
|
|
item: null # The DOM item the main React component renders into
|
|
|
|
activate: (@state={}) ->
|
|
# Register components we provide globally
|
|
ComponentRegistry.register
|
|
name: 'edgehill-reply-button'
|
|
role: 'MessageListPrimaryAction'
|
|
view: ReplyButton
|
|
ComponentRegistry.register
|
|
name: 'edgehill-reply-all-button'
|
|
role: 'MessageListPrimaryAction'
|
|
view: ReplyAllButton
|
|
ComponentRegistry.register
|
|
name: 'edgehill-forward-button'
|
|
role: 'MessageListPrimaryAction'
|
|
view: ForwardButton
|
|
ComponentRegistry.register
|
|
name: 'edgehill-archive-button'
|
|
role: 'MessageListPrimaryAction'
|
|
view: ArchiveButton
|
|
|
|
unless @item
|
|
@item = document.createElement("div")
|
|
@item.setAttribute("id", "message-list")
|
|
@item.setAttribute("class", "message-list")
|
|
|
|
atom.workspace.addColumnItem(@item, "message-and-composer")
|
|
|
|
React.render(<MessageList /> , @item)
|
|
|
|
deactivate: ->
|
|
ComponentRegistry.unregister 'edgehill-reply-button'
|
|
ComponentRegistry.unregister 'edgehill-reply-all-button'
|
|
ComponentRegistry.unregister 'edgehill-forward-button'
|
|
ComponentRegistry.unregister 'edgehill-archive-button'
|
|
|
|
React.unmountComponentAtNode(@item)
|
|
@item.remove()
|
|
@item = null
|
|
|
|
serialize: -> @state
|