fix(contact): only limit length if too long

This commit is contained in:
Evan Morikawa 2016-11-11 09:12:00 -05:00
parent 36abf5b608
commit 1739b3fbb3

View file

@ -83,8 +83,8 @@ class ContactStore extends NylasStore
return Promise.each extensions, (ext) => return Promise.each extensions, (ext) =>
return ext.findAdditionalContacts(search, results).then (contacts) => return ext.findAdditionalContacts(search, results).then (contacts) =>
results = contacts results = contacts
.then () => .then =>
results.length = limit if (results.length > limit) then results.length = limit
return Promise.resolve(results) return Promise.resolve(results)
isValidContact: (contact) => isValidContact: (contact) =>