mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 15:15:12 +08:00
fix(thread-list): Use hasAttachments
flag, fix bug where attachments icon did not appear in search results
This commit is contained in:
parent
83427c4541
commit
3a5a6ce7b9
3 changed files with 7 additions and 7 deletions
|
@ -104,8 +104,7 @@ class ThreadList extends React.Component
|
|||
resolver: (thread) =>
|
||||
attachment = []
|
||||
labels = []
|
||||
hasAttachments = _.find (thread.metadata ? []), (m) -> m.files.length > 0
|
||||
if hasAttachments
|
||||
if thread.hasAttachments
|
||||
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
||||
|
||||
currentCategoryId = FocusedMailViewStore.mailView()?.categoryId()
|
||||
|
@ -146,13 +145,11 @@ class ThreadList extends React.Component
|
|||
pencil = []
|
||||
attachment = []
|
||||
hasDraft = _.find (thread.metadata ? []), (m) -> m.draft
|
||||
hasAttachments = _.find (thread.metadata ? []), (m) -> m.files.length > 0
|
||||
if thread.hasAttachments
|
||||
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
||||
if hasDraft
|
||||
pencil = <RetinaImg name="icon-draft-pencil.png" className="draft-icon" mode={RetinaImg.Mode.ContentPreserve} />
|
||||
|
||||
if hasAttachments
|
||||
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
||||
|
||||
<div>
|
||||
<div style={display: 'flex'}>
|
||||
<ThreadListIcon thread={thread} />
|
||||
|
|
|
@ -22,7 +22,7 @@ class MenuItem extends React.Component
|
|||
- `checked` (optional) Pass a {Boolean} to specify whether the item is checked.
|
||||
###
|
||||
@propTypes:
|
||||
divider: React.PropTypes.bool
|
||||
divider: React.PropTypes.string
|
||||
key: React.PropTypes.string
|
||||
selected: React.PropTypes.bool
|
||||
checked: React.PropTypes.bool
|
||||
|
|
|
@ -75,6 +75,9 @@ class Thread extends Model
|
|||
modelKey: 'participants'
|
||||
itemClass: Contact
|
||||
|
||||
'hasAttachments': Attributes.Boolean
|
||||
modelKey: 'has_attachments'
|
||||
|
||||
'lastMessageReceivedTimestamp': Attributes.DateTime
|
||||
queryable: true
|
||||
modelKey: 'lastMessageReceivedTimestamp'
|
||||
|
|
Loading…
Reference in a new issue