Skip to content

Commit

Permalink
fix: post sharing URL (openedx#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyudyunov authored and sambapete committed Dec 11, 2023
1 parent cbb35e7 commit 6ea3493
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/discussions/posts/post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const Post = ({ handleAddResponseButton }) => {
}
}, [abuseFlagged, postId, showReportConfirmation]);

const handlePostCopyLink = useCallback(() => {
const postURL = new URL(`${getConfig().PUBLIC_PATH}${courseId}/posts/${post.id}`, window.location.origin);
navigator.clipboard.writeText(postURL.href);
}, [window.location.origin, post.id, courseId]);

const actionHandlers = useMemo(() => ({
[ContentActions.EDIT_CONTENT]: handlePostContentEdit,
[ContentActions.DELETE]: showDeleteConfirmation,
Expand Down

0 comments on commit 6ea3493

Please sign in to comment.