|
|
@ -29,14 +29,12 @@ export const fetchVisualMediaAttachments = async ({
|
|
|
|
await deferredToPromise(
|
|
|
|
await deferredToPromise(
|
|
|
|
collection.fetch({
|
|
|
|
collection.fetch({
|
|
|
|
index: {
|
|
|
|
index: {
|
|
|
|
// 'hasVisualMediaAttachments' index on
|
|
|
|
|
|
|
|
// [conversationId, hasVisualMediaAttachments, received_at]
|
|
|
|
|
|
|
|
name: 'hasVisualMediaAttachments',
|
|
|
|
name: 'hasVisualMediaAttachments',
|
|
|
|
lower: [conversationId, hasVisualMediaAttachments, lowerReceivedAt],
|
|
|
|
lower: [conversationId, hasVisualMediaAttachments, lowerReceivedAt],
|
|
|
|
upper: [conversationId, hasVisualMediaAttachments, upperReceivedAt],
|
|
|
|
upper: [conversationId, hasVisualMediaAttachments, upperReceivedAt],
|
|
|
|
order: 'desc',
|
|
|
|
order: 'desc',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
limit: 10,
|
|
|
|
limit: 50,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|