eternagame / eternagame.org

Website for the Eterna citizen science game
https://eternagame.org
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Add watcher to retrigger project data fetch on user login #360

Closed tkaragianes closed 1 year ago

tkaragianes commented 1 year ago

Summary

The lab page was incorrectly displaying the user submissions after a user had logged in (see issue #359).

Implementation Notes

This fix retriggers the project data fetch when the user store's logged in state changes. This is necessary because after the user logs in, we need to fetch the number of submitted solutions for this user now that we have their uid.

Testing

Verified fix on local dev server.

Related Issues

Closes #359.

luxaritas commented 1 year ago

Do we want this to prevent rendering when it's actively re-fetching?

tkaragianes commented 1 year ago

I'm not sure we do. Strictly speaking, if the backend code is fixed for proper handling of incognito users (e.g. returns 0 instead of totalSubmissions), then at most you might see the user submissions go from 0 to the proper number.

luxaritas commented 1 year ago

That's fixed in the new backend code. Fine with me to leave this as-is