Clear message previews when the maximum limit is reached for history

pull/21833/head
Travis Ralston 2021-02-17 22:36:26 -07:00
parent cc5ed3eeb2
commit 47d73bef57
1 changed files with 4 additions and 1 deletions

View File

@ -124,7 +124,10 @@ export class MessagePreviewStore extends AsyncStoreWithClient<IState> {
let changed = false;
for (let i = events.length - 1; i >= 0; i--) {
if (i === events.length - MAX_EVENTS_BACKWARDS) return; // limit reached
if (i === events.length - MAX_EVENTS_BACKWARDS) {
// limit reached - clear the preview by breaking out of the loop
break;
}
const event = events[i];
const previewDef = PREVIEWS[event.getType()];