mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 01:35:49 +03:00
Fix emoji picker for editing thread responses (#8671)
This commit is contained in:
parent
20fd68b902
commit
b4d657b21f
2 changed files with 15 additions and 0 deletions
|
@ -883,6 +883,8 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
if (payload.composerType) break;
|
||||
|
||||
let timelineRenderingType: TimelineRenderingType = payload.timelineRenderingType;
|
||||
// ThreadView handles Action.ComposerInsert itself due to it having its own editState
|
||||
if (timelineRenderingType === TimelineRenderingType.Thread) break;
|
||||
if (this.state.timelineRenderingType === TimelineRenderingType.Search &&
|
||||
payload.timelineRenderingType === TimelineRenderingType.Search
|
||||
) {
|
||||
|
|
|
@ -53,6 +53,7 @@ import PosthogTrackers from "../../PosthogTrackers";
|
|||
import { ButtonEvent } from "../views/elements/AccessibleButton";
|
||||
import { RoomViewStore } from '../../stores/RoomViewStore';
|
||||
import Spinner from "../views/elements/Spinner";
|
||||
import { ComposerInsertPayload, ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload";
|
||||
|
||||
interface IProps {
|
||||
room: Room;
|
||||
|
@ -136,6 +137,18 @@ export default class ThreadView extends React.Component<IProps, IState> {
|
|||
this.setupThread(payload.event);
|
||||
}
|
||||
switch (payload.action) {
|
||||
case Action.ComposerInsert: {
|
||||
if (payload.composerType) break;
|
||||
if (payload.timelineRenderingType !== TimelineRenderingType.Thread) break;
|
||||
|
||||
// re-dispatch to the correct composer
|
||||
dis.dispatch<ComposerInsertPayload>({
|
||||
...(payload as ComposerInsertPayload),
|
||||
composerType: this.state.editState ? ComposerType.Edit : ComposerType.Send,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case Action.EditEvent:
|
||||
// Quit early if it's not a thread context
|
||||
if (payload.timelineRenderingType !== TimelineRenderingType.Thread) return;
|
||||
|
|
Loading…
Reference in a new issue