Include videos in media gallery

This commit is contained in:
Daniel Gasienica 2018-04-25 11:15:12 -04:00
parent 37d73accde
commit f8119be97b

View file

@ -29,14 +29,15 @@ export const loadWithObjectURL = (loadMessage: MapAsync<Message>) => async (
}
// Messages with video are too expensive to load into memory, so we dont:
const [, messagesWithoutVideo] = partition(messages, hasVideoAttachment);
const [messagesWithVideo, messagesWithoutVideo] = partition(
messages,
hasVideoAttachment
);
const loadedMessagesWithoutVideo: Array<Message> = await Promise.all(
messagesWithoutVideo.map(loadMessage)
);
const loadedMessages = sortBy(
// // Only show images for MVP:
// [...messagesWithVideo, ...loadedMessagesWithoutVideo],
loadedMessagesWithoutVideo,
[...messagesWithVideo, ...loadedMessagesWithoutVideo],
message => -message.received_at
);