Fix quote button (#7096)

pull/21833/head
Šimon Brandner 2021-11-08 16:39:39 +01:00 committed by GitHub
parent 10caa4f9a4
commit f9c7417aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,7 @@ import ShareDialog from '../dialogs/ShareDialog';
import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks";
import { IPosition, ChevronFace } from '../../structures/ContextMenu'; import { IPosition, ChevronFace } from '../../structures/ContextMenu';
import RoomContext, { TimelineRenderingType } from '../../../contexts/RoomContext'; import RoomContext, { TimelineRenderingType } from '../../../contexts/RoomContext';
import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload";
export function canCancel(eventStatus: EventStatus): boolean { export function canCancel(eventStatus: EventStatus): boolean {
return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT; return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT;
@ -76,6 +77,7 @@ interface IState {
@replaceableComponent("views.context_menus.MessageContextMenu") @replaceableComponent("views.context_menus.MessageContextMenu")
export default class MessageContextMenu extends React.Component<IProps, IState> { export default class MessageContextMenu extends React.Component<IProps, IState> {
static contextType = RoomContext; static contextType = RoomContext;
public context!: React.ContextType<typeof RoomContext>;
state = { state = {
canRedact: false, canRedact: false,
@ -190,9 +192,10 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
}; };
private onQuoteClick = (): void => { private onQuoteClick = (): void => {
dis.dispatch({ dis.dispatch<ComposerInsertPayload>({
action: Action.ComposerInsert, action: Action.ComposerInsert,
event: this.props.mxEvent, event: this.props.mxEvent,
timelineRenderingType: this.context.timelineRenderingType,
}); });
this.closeMenu(); this.closeMenu();
}; };