From ec800dd0483a83231ceac6324cd3569854b6b907 Mon Sep 17 00:00:00 2001 From: sundasnoreen12 <72802712+sundasnoreen12@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:57:40 +0500 Subject: [PATCH] fix: fixed rate limit dialogue for edit contents (#797) --- .../post-comments/comments/comment/CommentEditor.jsx | 4 ++-- src/discussions/posts/post-editor/PostEditor.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/discussions/post-comments/comments/comment/CommentEditor.jsx b/src/discussions/post-comments/comments/comment/CommentEditor.jsx index ecd7c59a..94d045bc 100644 --- a/src/discussions/post-comments/comments/comment/CommentEditor.jsx +++ b/src/discussions/post-comments/comments/comment/CommentEditor.jsx @@ -94,10 +94,10 @@ const CommentEditor = ({ }; useEffect(() => { - if (contentCreationRateLimited) { + if (contentCreationRateLimited && !id) { openRestrictionDialogue(); } - }, [contentCreationRateLimited]); + }, [contentCreationRateLimited, id]); const handleCaptchaChange = useCallback((token, setFieldValue) => { setFieldValue('recaptchaToken', token || ''); diff --git a/src/discussions/posts/post-editor/PostEditor.jsx b/src/discussions/posts/post-editor/PostEditor.jsx index 0f3d8b2b..87fa21cb 100644 --- a/src/discussions/posts/post-editor/PostEditor.jsx +++ b/src/discussions/posts/post-editor/PostEditor.jsx @@ -177,10 +177,10 @@ const PostEditor = ({ }, [postId, topicId, post?.author, category, editExisting, commentsPagePath, location]); useEffect(() => { - if (contentCreationRateLimited) { + if (contentCreationRateLimited && !postId) { openRestrictionDialogue(); } - }, [contentCreationRateLimited]); + }, [contentCreationRateLimited, postId]); // null stands for no cohort restriction ("All learners" option) const selectedCohort = useCallback(