Restore contact/conversation differentiation in search results
This commit is contained in:
parent
0fc178d887
commit
c147e6ce25
2 changed files with 9 additions and 3 deletions
|
@ -15,6 +15,12 @@ import { AttachmentType } from '../../types/Attachment';
|
||||||
|
|
||||||
// State
|
// State
|
||||||
|
|
||||||
|
export type DBConversationType = {
|
||||||
|
id: string;
|
||||||
|
activeAt?: number;
|
||||||
|
lastMessage: string;
|
||||||
|
type: string;
|
||||||
|
};
|
||||||
export type ConversationType = {
|
export type ConversationType = {
|
||||||
id: string;
|
id: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
|
@ -11,8 +11,8 @@ import {
|
||||||
import { makeLookup } from '../../util/makeLookup';
|
import { makeLookup } from '../../util/makeLookup';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ConversationType,
|
|
||||||
ConversationUnloadedActionType,
|
ConversationUnloadedActionType,
|
||||||
|
DBConversationType,
|
||||||
MessageDeletedActionType,
|
MessageDeletedActionType,
|
||||||
MessageType,
|
MessageType,
|
||||||
RemoveAllConversationsActionType,
|
RemoveAllConversationsActionType,
|
||||||
|
@ -276,7 +276,7 @@ async function queryConversationsAndContacts(
|
||||||
const { ourNumber, noteToSelf } = options;
|
const { ourNumber, noteToSelf } = options;
|
||||||
const query = providedQuery.replace(/[+-.()]*/g, '');
|
const query = providedQuery.replace(/[+-.()]*/g, '');
|
||||||
|
|
||||||
const searchResults: Array<ConversationType> = await dataSearchConversations(
|
const searchResults: Array<DBConversationType> = await dataSearchConversations(
|
||||||
query
|
query
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ async function queryConversationsAndContacts(
|
||||||
for (let i = 0; i < max; i += 1) {
|
for (let i = 0; i < max; i += 1) {
|
||||||
const conversation = searchResults[i];
|
const conversation = searchResults[i];
|
||||||
|
|
||||||
if (conversation.type === 'direct' && !Boolean(conversation.lastMessage)) {
|
if (conversation.type === 'private' && !Boolean(conversation.lastMessage)) {
|
||||||
contacts.push(conversation.id);
|
contacts.push(conversation.id);
|
||||||
} else {
|
} else {
|
||||||
conversations.push(conversation.id);
|
conversations.push(conversation.id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue