Restore contact/conversation differentiation in search results

This commit is contained in:
Scott Nonnenberg 2020-02-06 11:52:05 -08:00 committed by GitHub
parent 0fc178d887
commit c147e6ce25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -15,6 +15,12 @@ import { AttachmentType } from '../../types/Attachment';
// State
export type DBConversationType = {
id: string;
activeAt?: number;
lastMessage: string;
type: string;
};
export type ConversationType = {
id: string;
name?: string;

View File

@ -11,8 +11,8 @@ import {
import { makeLookup } from '../../util/makeLookup';
import {
ConversationType,
ConversationUnloadedActionType,
DBConversationType,
MessageDeletedActionType,
MessageType,
RemoveAllConversationsActionType,
@ -276,7 +276,7 @@ async function queryConversationsAndContacts(
const { ourNumber, noteToSelf } = options;
const query = providedQuery.replace(/[+-.()]*/g, '');
const searchResults: Array<ConversationType> = await dataSearchConversations(
const searchResults: Array<DBConversationType> = await dataSearchConversations(
query
);
@ -287,7 +287,7 @@ async function queryConversationsAndContacts(
for (let i = 0; i < max; i += 1) {
const conversation = searchResults[i];
if (conversation.type === 'direct' && !Boolean(conversation.lastMessage)) {
if (conversation.type === 'private' && !Boolean(conversation.lastMessage)) {
contacts.push(conversation.id);
} else {
conversations.push(conversation.id);