Skip to content

Commit

Permalink
Removed redundant code from forum main page that was causing an error…
Browse files Browse the repository at this point in the history
… in deletion of posts
  • Loading branch information
Orqoi committed Jul 25, 2022
1 parent 4cfb40c commit 702e80d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/src/containers/ForumApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default function ForumApp() {

useEffect(() => {
// posts dependency removed due to infinite loop
console.log("wtf")
const updatedBySorter = false;
dispatch(getPosts({
postLength: posts.length,
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/containers/ForumMainPage/ForumMainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ function ForumMainPage(props) {
if (isError) {
toast.error(message)
}

dispatch(getPosts({
postLength: props.posts.length,
updatedBySorter: false
})).then(() => dispatch(reset()))
// dispatch(getPosts({
// postLength: props.posts.length,
// updatedBySorter: false
// })).then(() => dispatch(reset()))

dispatch(resetUser())
}, [dispatch, isSuccess, message, isError])
Expand Down

0 comments on commit 702e80d

Please sign in to comment.