Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post view page generates infinite network requests #365

Open
itaykat opened this issue Dec 2, 2023 · 2 comments · May be fixed by #387
Open

Post view page generates infinite network requests #365

itaykat opened this issue Dec 2, 2023 · 2 comments · May be fixed by #387

Comments

@itaykat
Copy link

itaykat commented Dec 2, 2023

When entering a specific post, the page generates non stop POST requests
to thttps://app.domain.com/post/<page_id>

@jocadevone
Copy link

I solved it by adding an empty array as a dependency in the useeffect in the nav.tsx component.
I'm not sure it's the right thing to do, but it works.
Screenshot 2024-01-05 at 7 46 19 p m

@JoeCam88
Copy link

I had the same problem, but when I remove the dependency array then the navigation will not work correctly and the "Back to all posts" menu will take back to the all sites page.
My solution for the issue to add the siteId to the dependency list in the nav.tsx, so finally it looks like this.

useEffect(() => {
    if (segments[0] === "post" && id && !siteId) {
      getSiteFromPostId(id).then((id) => {
        setSiteId(id);
      });
    }
  }, [segments, id, siteId]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants