Load documents for media gallery
This commit is contained in:
parent
f8119be97b
commit
954433366e
1 changed files with 13 additions and 6 deletions
|
@ -577,17 +577,24 @@
|
||||||
// events up to its parent elements in the DOM.
|
// events up to its parent elements in the DOM.
|
||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
|
|
||||||
const media = await Signal.Backbone.Conversation.fetchVisualMediaAttachments({
|
const conversationId = this.model.get('id');
|
||||||
conversationId: this.model.get('id'),
|
const WhisperMessageCollection = Whisper.MessageCollection;
|
||||||
WhisperMessageCollection: Whisper.MessageCollection,
|
const rawMedia = await Signal.Backbone.Conversation.fetchVisualMediaAttachments({
|
||||||
|
conversationId,
|
||||||
|
WhisperMessageCollection,
|
||||||
});
|
});
|
||||||
|
const documents = await Signal.Backbone.Conversation.fetchFileAttachments({
|
||||||
|
conversationId,
|
||||||
|
WhisperMessageCollection,
|
||||||
|
});
|
||||||
|
|
||||||
const loadMessages = Signal.Components.PropTypes.Message
|
const loadMessages = Signal.Components.PropTypes.Message
|
||||||
.loadWithObjectURL(Signal.Migrations.loadMessage);
|
.loadWithObjectURL(Signal.Migrations.loadMessage);
|
||||||
const mediaWithObjectURLs = await loadMessages(media);
|
const media = await loadMessages(rawMedia);
|
||||||
|
|
||||||
const mediaGalleryProps = {
|
const mediaGalleryProps = {
|
||||||
media: mediaWithObjectURLs,
|
media,
|
||||||
documents: [],
|
documents,
|
||||||
onItemClick: ({ message }) => {
|
onItemClick: ({ message }) => {
|
||||||
const lightboxProps = {
|
const lightboxProps = {
|
||||||
imageURL: message.objectURL,
|
imageURL: message.objectURL,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue