zeeguu / web

Frontend for the zeeguu web application.
https://www.zeeguu.org
5 stars 7 forks source link

articleListRef.current not defined #407

Closed tfnribeiro closed 3 months ago

tfnribeiro commented 3 months ago

I have noticed that sometimes I still see this error in the master branch, even though I only create the event when the articles are loaded in.

I am not sure if my understanding is correct, but I feel like what might be attaching the event when the articles return, which might be slower than when the user leaves the page. I am not sure if then the component performs the clean up (as the event wasn't attached yet).

So maybe the best fix is to not run the code unless that variable is defined - this way if for some reason the event is left - it will not be run.