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

Only fetch stats for logged in users #2578

Merged
merged 4 commits into from
Apr 16, 2023
Merged

Only fetch stats for logged in users #2578

merged 4 commits into from
Apr 16, 2023

Conversation

AbdBarho
Copy link
Collaborator

@AbdBarho AbdBarho commented Apr 16, 2023

Related to #2569

I will have to check in the console after deployment to see if it actually fixes the problem, but it worked on my local setup.

@AbdBarho AbdBarho changed the title Only fetch board for logged in users Only fetch stats for logged in users Apr 16, 2023
@AbdBarho AbdBarho added bug Something isn't working website labels Apr 16, 2023
@AbdBarho AbdBarho marked this pull request as ready for review April 16, 2023 07:29
@AbdBarho AbdBarho requested a review from notmd as a code owner April 16, 2023 07:29
if (!token.backendUserId) {
// user has not yet accepted the terms of service, and therefor does not yet exist in the backend
/// skip the request entirely
return res.status(200).json(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break the UI?

Copy link
Collaborator Author

@AbdBarho AbdBarho Apr 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it should not, the leaderboard will be empty.

It is also not visble since the ToS wrapper covers the entire screen, after the user accepts ToS the webpage is refreshed and a new request is made.

Another option we can do is send 404 and let useSWR retry. We then know that this is expected.

@notmd notmd merged commit b92fc59 into main Apr 16, 2023
@notmd notmd deleted the fetch-login branch April 16, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants