mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Skip generatePreview if event is not part of the live timeline
This commit is contained in:
parent
7ecd96b320
commit
e934f81521
@ -176,7 +176,7 @@ export class MessagePreviewStore extends AsyncStoreWithClient<IState> {
|
|||||||
|
|
||||||
if (payload.action === 'MatrixActions.Room.timeline' || payload.action === 'MatrixActions.Event.decrypted') {
|
if (payload.action === 'MatrixActions.Room.timeline' || payload.action === 'MatrixActions.Event.decrypted') {
|
||||||
const event = payload.event; // TODO: Type out the dispatcher
|
const event = payload.event; // TODO: Type out the dispatcher
|
||||||
if (!this.previews.has(event.getRoomId())) return; // not important
|
if (!this.previews.has(event.getRoomId()) || !event.isLiveEvent) return; // not important
|
||||||
await this.generatePreview(this.matrixClient.getRoom(event.getRoomId()), TAG_ANY);
|
await this.generatePreview(this.matrixClient.getRoom(event.getRoomId()), TAG_ANY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user