mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
Contact first names now set to the first non-article word
Summary: Fixes T2179. This fixes the weird bug where first names like "The Nylas Team" was shortened to "The". The fix just chooses the first non-article word as the first name Test Plan: tested manually Reviewers: bengotow Reviewed By: bengotow Subscribers: jennie Maniphest Tasks: T2179 Differential Revision: https://phab.nylas.com/D1715
This commit is contained in:
parent
343bb3163b
commit
9df066808b
|
@ -79,7 +79,11 @@ class Contact extends Model
|
|||
@lastName()
|
||||
|
||||
firstName: ->
|
||||
@_nameParts()[0] ? ""
|
||||
articles = ['a', 'the']
|
||||
for part in @_nameParts()
|
||||
if part.toLowerCase() not in articles
|
||||
return part
|
||||
return ""
|
||||
|
||||
lastName: ->
|
||||
@_nameParts()[1..-1]?.join(" ") ? ""
|
||||
|
|
Loading…
Reference in a new issue