mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 23:23:54 +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) =>
|
resolver: (thread) =>
|
||||||
attachment = []
|
attachment = []
|
||||||
labels = []
|
labels = []
|
||||||
hasAttachments = _.find (thread.metadata ? []), (m) -> m.files.length > 0
|
if thread.hasAttachments
|
||||||
if hasAttachments
|
|
||||||
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
||||||
|
|
||||||
currentCategoryId = FocusedMailViewStore.mailView()?.categoryId()
|
currentCategoryId = FocusedMailViewStore.mailView()?.categoryId()
|
||||||
|
@ -146,13 +145,11 @@ class ThreadList extends React.Component
|
||||||
pencil = []
|
pencil = []
|
||||||
attachment = []
|
attachment = []
|
||||||
hasDraft = _.find (thread.metadata ? []), (m) -> m.draft
|
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
|
if hasDraft
|
||||||
pencil = <RetinaImg name="icon-draft-pencil.png" className="draft-icon" mode={RetinaImg.Mode.ContentPreserve} />
|
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>
|
||||||
<div style={display: 'flex'}>
|
<div style={display: 'flex'}>
|
||||||
<ThreadListIcon thread={thread} />
|
<ThreadListIcon thread={thread} />
|
||||||
|
|
|
@ -22,7 +22,7 @@ class MenuItem extends React.Component
|
||||||
- `checked` (optional) Pass a {Boolean} to specify whether the item is checked.
|
- `checked` (optional) Pass a {Boolean} to specify whether the item is checked.
|
||||||
###
|
###
|
||||||
@propTypes:
|
@propTypes:
|
||||||
divider: React.PropTypes.bool
|
divider: React.PropTypes.string
|
||||||
key: React.PropTypes.string
|
key: React.PropTypes.string
|
||||||
selected: React.PropTypes.bool
|
selected: React.PropTypes.bool
|
||||||
checked: React.PropTypes.bool
|
checked: React.PropTypes.bool
|
||||||
|
|
|
@ -75,6 +75,9 @@ class Thread extends Model
|
||||||
modelKey: 'participants'
|
modelKey: 'participants'
|
||||||
itemClass: Contact
|
itemClass: Contact
|
||||||
|
|
||||||
|
'hasAttachments': Attributes.Boolean
|
||||||
|
modelKey: 'has_attachments'
|
||||||
|
|
||||||
'lastMessageReceivedTimestamp': Attributes.DateTime
|
'lastMessageReceivedTimestamp': Attributes.DateTime
|
||||||
queryable: true
|
queryable: true
|
||||||
modelKey: 'lastMessageReceivedTimestamp'
|
modelKey: 'lastMessageReceivedTimestamp'
|
||||||
|
|
Loading…
Reference in a new issue