[FIX] Can't copy or edit media's description (#2885)
* [FIX] Image descriptions issues * shorten the condition string * fix selectedMessage state Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
450aca4d7c
commit
5b518b4207
|
@ -171,7 +171,7 @@ const MessageActions = React.memo(forwardRef(({
|
||||||
|
|
||||||
const handleCopy = async(message) => {
|
const handleCopy = async(message) => {
|
||||||
logEvent(events.ROOM_MSG_ACTION_COPY);
|
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') });
|
EventEmitter.emit(LISTENER, { message: I18n.t('Copied_to_clipboard') });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,14 @@ class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onEditInit = (message) => {
|
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 = () => {
|
onEditCancel = () => {
|
||||||
|
|
Loading…
Reference in New Issue