Fix messages_preview index

This commit is contained in:
Fedor Indutny 2022-01-07 11:51:41 -08:00 committed by GitHub
parent f49df88877
commit fa8ff2ae4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 7 deletions

View file

@ -2541,10 +2541,8 @@ function getLastConversationActivity({
}
function getLastConversationPreview({
conversationId,
ourUuid,
}: {
conversationId: string;
ourUuid: UUIDStringType;
}): MessageType | undefined {
const db = getInstance();
const row = prepare(
@ -2565,7 +2563,6 @@ function getLastConversationPreview({
`
).get({
conversationId,
ourUuid,
now: Date.now(),
});
@ -2591,10 +2588,7 @@ async function getLastConversationMessages({
conversationId,
ourUuid,
}),
preview: getLastConversationPreview({
conversationId,
ourUuid,
}),
preview: getLastConversationPreview({ conversationId }),
hasUserInitiatedMessages: hasUserInitiatedMessages(conversationId),
};
})();