mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/composer: fix editing text
This commit is contained in:
parent
24836f5006
commit
6e25cc7f20
1 changed files with 4 additions and 1 deletions
|
@ -159,9 +159,12 @@ const MessageComposer = () => {
|
||||||
const isMedia = mediaMsgTypes.includes(evtContent.msgtype)
|
const isMedia = mediaMsgTypes.includes(evtContent.msgtype)
|
||||||
&& Boolean(evt.content?.url || evt.content?.file?.url)
|
&& Boolean(evt.content?.url || evt.content?.file?.url)
|
||||||
rawSetEditing(evt)
|
rawSetEditing(evt)
|
||||||
|
const textIsEditable = (evt.content.filename && evt.content.filename !== evt.content.body)
|
||||||
|
|| evt.type === "m.sticker"
|
||||||
|
|| !isMedia
|
||||||
setState({
|
setState({
|
||||||
media: isMedia ? evtContent as MediaMessageEventContent : null,
|
media: isMedia ? evtContent as MediaMessageEventContent : null,
|
||||||
text: (evt.content.filename && evt.content.filename !== evt.content.body) || evt.type === "m.sticker"
|
text: textIsEditable
|
||||||
? (evt.local_content?.edit_source ?? evtContent.body ?? "")
|
? (evt.local_content?.edit_source ?? evtContent.body ?? "")
|
||||||
: "",
|
: "",
|
||||||
replyTo: null,
|
replyTo: null,
|
||||||
|
|
Loading…
Add table
Reference in a new issue