Expose and pre-populate thread ID in devtools dialog (#10953)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
cfd48b36aa
commit
8a97e5f351
8 changed files with 286 additions and 48 deletions
|
@ -88,6 +88,7 @@ export default BaseTool;
|
|||
|
||||
interface IContext {
|
||||
room: Room;
|
||||
threadRootId?: string | null;
|
||||
}
|
||||
|
||||
export const DevtoolsContext = createContext<IContext>({} as IContext);
|
||||
|
|
|
@ -204,6 +204,13 @@ export const TimelineEventEditor: React.FC<IEditorProps> = ({ mxEvent, onBack })
|
|||
};
|
||||
|
||||
defaultContent = stringify(newContent);
|
||||
} else if (context.threadRootId) {
|
||||
defaultContent = stringify({
|
||||
"m.relates_to": {
|
||||
rel_type: "m.thread",
|
||||
event_id: context.threadRootId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return <EventEditor fieldDefs={fields} defaultContent={defaultContent} onSend={onSend} onBack={onBack} />;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue