From ccdacfea32cd59472ddc4d62d2f3c4064588fbff Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Fri, 4 Oct 2024 17:28:58 +0200 Subject: [PATCH] fix(reply): permalink button could be clicked while post is pending --- .../post/comment-tools/comment-tools.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/post/comment-tools/comment-tools.tsx b/src/components/post/comment-tools/comment-tools.tsx index 2da09501..1dddda96 100644 --- a/src/components/post/comment-tools/comment-tools.tsx +++ b/src/components/post/comment-tools/comment-tools.tsx @@ -125,7 +125,13 @@ const ReplyTools = ({ }: CommentToolsProps) => { const { t } = useTranslation(); - const permalink = failed ? permalink : permalink; + const permalink = failed ? ( + permalink + ) : ( + !cid && e.preventDefault()}> + permalink + + ); return ( <> @@ -165,7 +171,13 @@ const SingleReplyTools = ({ const hasContext = parentCid !== postCid; - const permalinkButton = cid ? permalink : permalink; + const permalinkButton = cid ? ( + !cid && e.preventDefault()}> + permalink + + ) : ( + permalink + ); const contextButton = cid ? ( {t('context')}