mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-24 09:16:07 +08:00
26 lines
538 B
JavaScript
26 lines
538 B
JavaScript
import {
|
|
Contact,
|
|
ModelSearchIndexer,
|
|
} from 'nylas-exports';
|
|
|
|
class ContactSearchIndexStore extends ModelSearchIndexer {
|
|
|
|
modelClass() { return Contact }
|
|
|
|
configKey() { return "contactSearchIndexVersion" }
|
|
|
|
INDEX_VERSION() { return 1 }
|
|
|
|
getIndexDataForModel(contact) {
|
|
return {
|
|
content: [
|
|
contact.name ? contact.name : '',
|
|
contact.email ? contact.email : '',
|
|
contact.email ? contact.email.replace('@', ' ') : '',
|
|
].join(' '),
|
|
};
|
|
}
|
|
}
|
|
|
|
export default new ContactSearchIndexStore()
|