Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix ComposerEvent TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Alun Turner committed Jul 11, 2023
1 parent 20ea582 commit 94cfb9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/views/rooms/EditMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
inThread: !!editedEvent?.getThread(),
isReply: !!editedEvent.replyEventId,
isLocation: false,
editor: "Legacy",
isMarkdownEnabled: SettingsStore.getValue("MessageComposerInput.useMarkdown"),
});

// Replace emoticon at the end of the message
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/rooms/SendMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
isReply: !!this.props.replyToEvent,
inThread: this.props.relation?.rel_type === THREAD_RELATION_TYPE.name,
isLocation: false,
editor: "Legacy",
isMarkdownEnabled: SettingsStore.getValue("MessageComposerInput.useMarkdown"),
};
if (posthogEvent.inThread && this.props.relation!.event_id) {
const threadRoot = this.props.room.findEventById(this.props.relation!.event_id);
Expand Down
4 changes: 4 additions & 0 deletions src/components/views/rooms/wysiwyg_composer/utils/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export async function sendMessage(
isReply: Boolean(replyToEvent),
inThread: relation?.rel_type === THREAD_RELATION_TYPE.name,
isLocation: false,
editor: isHTML ? "RteFormatting" : "RtePlain",
isMarkdownEnabled: false,
};

if (posthogEvent.inThread) {
Expand Down Expand Up @@ -201,6 +203,8 @@ export async function editMessage(
inThread: Boolean(editedEvent?.getThread()),
isReply: Boolean(editedEvent.replyEventId),
isLocation: false,
editor: "RteFormatting", // it is always the rich text mode when editing a message
isMarkdownEnabled: false,
});

// TODO emoji
Expand Down

0 comments on commit 94cfb9d

Please sign in to comment.