Skip to content

Commit ec800dd

Browse files
fix: fixed rate limit dialogue for edit contents (#797)
1 parent a026911 commit ec800dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/discussions/post-comments/comments/comment/CommentEditor.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ const CommentEditor = ({
9494
};
9595

9696
useEffect(() => {
97-
if (contentCreationRateLimited) {
97+
if (contentCreationRateLimited && !id) {
9898
openRestrictionDialogue();
9999
}
100-
}, [contentCreationRateLimited]);
100+
}, [contentCreationRateLimited, id]);
101101

102102
const handleCaptchaChange = useCallback((token, setFieldValue) => {
103103
setFieldValue('recaptchaToken', token || '');

src/discussions/posts/post-editor/PostEditor.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ const PostEditor = ({
177177
}, [postId, topicId, post?.author, category, editExisting, commentsPagePath, location]);
178178

179179
useEffect(() => {
180-
if (contentCreationRateLimited) {
180+
if (contentCreationRateLimited && !postId) {
181181
openRestrictionDialogue();
182182
}
183-
}, [contentCreationRateLimited]);
183+
}, [contentCreationRateLimited, postId]);
184184

185185
// null stands for no cohort restriction ("All learners" option)
186186
const selectedCohort = useCallback(

0 commit comments

Comments
 (0)