mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-12 07:34:52 +08:00
fix(default-alias):Show correct list of accounts and aliases in composer
This commit is contained in:
parent
9974d24487
commit
65a29a250c
3 changed files with 14 additions and 18 deletions
|
@ -73,13 +73,6 @@ class MessageControls extends React.Component
|
||||||
_onForward: =>
|
_onForward: =>
|
||||||
Actions.composeForward(thread: @props.thread, message: @props.message)
|
Actions.composeForward(thread: @props.thread, message: @props.message)
|
||||||
|
|
||||||
_replyType: =>
|
|
||||||
emails = @props.message.to.map (item) -> item.email.toLowerCase().trim()
|
|
||||||
myEmail = @_account()?.me().email.toLowerCase().trim()
|
|
||||||
if @props.message.cc.length is 0 and @props.message.to.length is 1 and emails[0] is myEmail
|
|
||||||
return "reply"
|
|
||||||
else return "reply-all"
|
|
||||||
|
|
||||||
_onShowActionsMenu: =>
|
_onShowActionsMenu: =>
|
||||||
SystemMenu = remote.require('menu')
|
SystemMenu = remote.require('menu')
|
||||||
SystemMenuItem = remote.require('menu-item')
|
SystemMenuItem = remote.require('menu-item')
|
||||||
|
|
|
@ -69,9 +69,6 @@ class Account extends Model
|
||||||
|
|
||||||
# Returns a {Contact} model that represents the current user.
|
# Returns a {Contact} model that represents the current user.
|
||||||
me: ->
|
me: ->
|
||||||
if @defaultAlias
|
|
||||||
return @meUsingAlias(@defaultAlias)
|
|
||||||
else
|
|
||||||
Contact = require './contact'
|
Contact = require './contact'
|
||||||
return new Contact
|
return new Contact
|
||||||
accountId: @id
|
accountId: @id
|
||||||
|
@ -83,6 +80,12 @@ class Account extends Model
|
||||||
return @me() unless alias
|
return @me() unless alias
|
||||||
return Contact.fromString(alias, accountId: @id)
|
return Contact.fromString(alias, accountId: @id)
|
||||||
|
|
||||||
|
defaultMe: ->
|
||||||
|
if @defaultAlias
|
||||||
|
return @meUsingAlias(@defaultAlias)
|
||||||
|
else
|
||||||
|
return @me()
|
||||||
|
|
||||||
usesLabels: ->
|
usesLabels: ->
|
||||||
@organizationUnit is "label"
|
@organizationUnit is "label"
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@ class DraftStore
|
||||||
account = AccountStore.accountForId(thread.accountId)
|
account = AccountStore.accountForId(thread.accountId)
|
||||||
throw new Error("Cannot find #{thread.accountId}") unless account
|
throw new Error("Cannot find #{thread.accountId}") unless account
|
||||||
return new Message _.extend {}, attributes,
|
return new Message _.extend {}, attributes,
|
||||||
from: [account.me()]
|
from: [account.defaultMe()]
|
||||||
date: (new Date)
|
date: (new Date)
|
||||||
draft: true
|
draft: true
|
||||||
pristine: true
|
pristine: true
|
||||||
|
@ -385,7 +385,7 @@ class DraftStore
|
||||||
|
|
||||||
draft = new Message
|
draft = new Message
|
||||||
body: ""
|
body: ""
|
||||||
from: [account.me()]
|
from: [account.defaultMe()]
|
||||||
date: (new Date)
|
date: (new Date)
|
||||||
draft: true
|
draft: true
|
||||||
pristine: true
|
pristine: true
|
||||||
|
@ -463,7 +463,7 @@ class DraftStore
|
||||||
draft = new Message
|
draft = new Message
|
||||||
body: query.body || ''
|
body: query.body || ''
|
||||||
subject: query.subject || '',
|
subject: query.subject || '',
|
||||||
from: [account.me()]
|
from: [account.defaultMe()]
|
||||||
date: (new Date)
|
date: (new Date)
|
||||||
draft: true
|
draft: true
|
||||||
pristine: true
|
pristine: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue