Here is the website.
Down lower, the website grads data from an endpoint and produces the amount of divi donated. I would like this number to update when the page is loaded and every 5 seconds.
However, when page loads I get 1 of three answers: the amount that was there the first time I previewed the page (29938), zero, and the correct number (currently 30106). The “every 5 seconds” never works.
The way the flow goes, is that I load in data into a state that is associated with the index page. Then I use that state to display what I need.
This is from a template, so there is also some JS that happens. I have no idea what it does
So here are the two steps from the “when page loads”
Here it is again on the “every 5 seconds”
Why cant I get it to load reliably, correctly and frequently?