From c5e78a321dde8a7aa105589b4c7c72d93e741138 Mon Sep 17 00:00:00 2001 From: plebbitor Date: Thu, 20 Apr 2023 11:19:56 +0200 Subject: [PATCH] fix cid link default click --- src/components/views/Board.jsx | 40 +++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index f23efb28..3f0b8a9a 100644 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -460,8 +460,12 @@ const Board = () => { {}} key={`pl1-${thread.cid}`} onClick={() => {}} title="Link to this post">c/ { - setIsReplyOpen(true); setSelectedShortCid(thread.shortCid); setSelectedParentCid(thread.cid); + onClick={(e) => { + if (e.button === 2) return; + e.preventDefault(); + setIsReplyOpen(true); + setSelectedShortCid(thread.shortCid); + setSelectedParentCid(thread.cid); }} title="Reply to this post">{thread.shortCid}     @@ -554,8 +558,12 @@ const Board = () => { {}} key={`pl1-${reply.cid}`} onClick={() => {}} title="Link to this post">c/ { - setIsReplyOpen(true); setSelectedShortCid(reply.shortCid); setSelectedParentCid(reply.cid); + onClick={(e) => { + if (e.button === 2) return; + e.preventDefault(); + setIsReplyOpen(true); + setSelectedShortCid(reply.shortCid); + setSelectedParentCid(reply.cid); }} title="Reply to this post">{reply.shortCid}   @@ -696,9 +704,15 @@ const Board = () => { {getDate(thread.timestamp)}   {}} key={`mob-no-${thread.cid}`} onClick={() => {}} title="Link to this post">c/ - { - setIsReplyOpen(true); setSelectedShortCid(thread.shortCid); setSelectedParentCid(thread.cid); - }} title="Reply to this post">{thread.shortCid} + { + if (e.button === 2) return; + e.preventDefault(); + setIsReplyOpen(true); + setSelectedShortCid(thread.shortCid); + setSelectedParentCid(thread.cid); + }} title="Reply to this post">{thread.shortCid} + {thread.link ? ( @@ -801,9 +815,15 @@ const Board = () => { {getDate(reply.timestamp)}  {}} key={`mob-pl1-${reply.cid}`} onClick={() => {}} title="Link to this post">c/ - { - setIsReplyOpen(true); setSelectedShortCid(reply.shortCid); setSelectedParentCid(reply.cid) - }} title="Reply to this post">{reply.shortCid} + { + if (e.button === 2) return; + e.preventDefault(); + setIsReplyOpen(true); + setSelectedShortCid(reply.shortCid); + setSelectedParentCid(reply.cid); + }} title="Reply to this post">{reply.shortCid} + {reply.link ? (