Ensure that media messages are cached when loaded from convo settings

This commit is contained in:
Scott Nonnenberg 2022-11-28 14:40:22 -08:00 committed by GitHub
parent b98836d0b3
commit ca638dd44f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -2,7 +2,6 @@
// SPDX-License-Identifier: AGPL-3.0-only
export type RateLimitedErrorPayloadType = Readonly<{
// eslint-disable-next-line camelcase
retry_after?: number;
}>;

View file

@ -2218,6 +2218,11 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
limit,
});
// Cache these messages in memory to ensure Lightbox can find them
messages.forEach(message => {
window.MessageController.register(message.id, message);
});
const loadedRecentMediaItems = messages
.filter(message => message.attachments !== undefined)
.reduce(