mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
1a576d92dc
Summary: Move sync workers and Edgehill token checks to work window Move the task queue and database setup to the work window Move ContactStore background refresh to work window Store the task queue in the database WIP The TaskQueue now puts tasks in the database instead of in a file, which also means it can be observed Move all delta sync and initial sync to a package, make NylasSyncStore which exposes read-only sync state DraftStore no longer reads task status. Once you set the "sending" bit on a draft, it never gets unset. But that's fine actually. If your package lists windowTypes, you *only* get loaded in those windowTypes. If you specify no windowTypes, you get loaded in the root window. This means that onboarding, worker-ui, worker-sync, etc. no longer get loaded into the main window ActivitySidebar has a special little store that observes the task queue since it's no longer in the window Move "toggle component regions" / "toggle react remote" to the Developer menu Move sync worker specs, update draft store specs to not rely on TaskQueue at all Test Plan: Run existing tests, all pass Reviewers: dillon, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D1936
43 lines
1.2 KiB
CoffeeScript
43 lines
1.2 KiB
CoffeeScript
React = require 'react/addons'
|
|
moment = require 'moment'
|
|
{Utils} = require 'nylas-exports'
|
|
|
|
class DeveloperBarLongPollItem extends React.Component
|
|
@displayName: 'DeveloperBarLongPollItem'
|
|
|
|
constructor: (@props) ->
|
|
@state = expanded: false
|
|
|
|
shouldComponentUpdate: (nextProps, nextState) =>
|
|
return not Utils.isEqualReact(nextProps, @props) or not Utils.isEqualReact(nextState, @state)
|
|
|
|
render: =>
|
|
if @state.expanded
|
|
payload = JSON.stringify(@props.item)
|
|
else
|
|
payload = []
|
|
|
|
itemId = @props.item.id
|
|
itemVersion = @props.item.version || @props.item.attributes?.version
|
|
itemId += " (version #{itemVersion})" if itemVersion
|
|
|
|
timestamp = moment(@props.item.timestamp).format("h:mm:ss")
|
|
|
|
classname = "item"
|
|
right = @props.item.cursor
|
|
|
|
if @props.item.ignoredBecause
|
|
classname += " ignored"
|
|
right = @props.item.ignoredBecause + " - " + right
|
|
|
|
<div className={classname} onClick={ => @setState expanded: not @state?.expanded}>
|
|
<div className="cursor">{right}</div>
|
|
{" #{timestamp}: #{@props.item.event} #{@props.item.object} #{itemId}"}
|
|
<div className="payload" onClick={ (e) -> e.stopPropagation() }>
|
|
{payload}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
module.exports = DeveloperBarLongPollItem
|