Unverified Commit 5b518b42 authored by Gung Wah's avatar Gung Wah Committed by GitHub
Browse files

[FIX] Can't copy or edit media's description (#2885)



* [FIX] Image descriptions issues

* shorten the condition string

* fix selectedMessage state
Co-authored-by: default avatarDiego Mello <diegolmello@gmail.com>
parent 450aca4d
......@@ -171,7 +171,7 @@ const MessageActions = React.memo(forwardRef(({
const handleCopy = async(message) => {
logEvent(events.ROOM_MSG_ACTION_COPY);
await Clipboard.setString(message.msg);
await Clipboard.setString(message?.attachments?.[0]?.description || message.msg);
EventEmitter.emit(LISTENER, { message: I18n.t('Copied_to_clipboard') });
};
......
......@@ -533,7 +533,14 @@ class RoomView extends React.Component {
}
onEditInit = (message) => {
this.setState({ selectedMessage: message, editing: true });
const newMessage = {
id: message.id,
subscription: {
id: message.subscription.id
},
msg: message?.attachments?.[0]?.description || message.msg
};
this.setState({ selectedMessage: newMessage, editing: true });
}
onEditCancel = () => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment