Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/containers/MessageActions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') });
};

Expand Down
9 changes: 8 additions & 1 deletion app/views/RoomView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,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 = () => {
Expand Down