Fix incorrect liveTimeline reference (#6948)

Fixes https://github.com/vector-im/element-web/issues/19400
This commit is contained in:
Dariusz Niemczyk 2021-10-14 17:37:56 +02:00 committed by GitHub
parent c31bd8c647
commit 2dd6dddc67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,6 +143,8 @@ interface ISendMessageComposerProps extends MatrixClientProps {
@replaceableComponent("views.rooms.SendMessageComposer")
export class SendMessageComposer extends React.Component<ISendMessageComposerProps> {
static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
private readonly prepareToEncrypt?: DebouncedFunc<() => void>;
private readonly editorRef = createRef<BasicMessageComposer>();
private model: EditorModel = null;
@ -279,7 +281,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
}
private sendQuickReaction(): void {
const timeline = this.context.liveTimeline();
const timeline = this.context.liveTimeline;
const events = timeline.getEvents();
const reaction = this.model.parts[1].text;
for (let i = events.length - 1; i >= 0; i--) {