mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +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
45bb16561f
commit
c306f553a4
1 changed files with 5 additions and 1 deletions
|
@ -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