Skip to content

Commit

Permalink
fix minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Jan 4, 2024
1 parent 671d1cb commit 587643a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/devhub/entity/post/PostEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ useEffect(() => {
if (!postData) {
setPostData(data);
}
if (postData && JSON.stringify(postData) !== JSON.stringify(data)) {
if (postData && data && JSON.stringify(postData) !== JSON.stringify(data)) {
props.setEditorState(false);
props.setExpandReplies(true);
setPostData(data);
Expand All @@ -100,7 +100,11 @@ useEffect(() => {
if (!postIdList) {
setPostIdList(postIds);
}
if (postIdList?.length > 0 && postIdList.length !== postIds.length) {
if (
postIdList?.length > 0 &&
postIds.length > 0 &&
postIdList.length !== postIds.length
) {
props.onDraftStateChange(null);
if (isCreatePostPage) {
setShowPostPage(true);
Expand Down

0 comments on commit 587643a

Please sign in to comment.