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

Visited state is set for challenges which are not visited #101

Open
CloseChoice opened this issue Sep 2, 2023 · 3 comments
Open

Visited state is set for challenges which are not visited #101

CloseChoice opened this issue Sep 2, 2023 · 3 comments
Assignees

Comments

@CloseChoice
Copy link
Owner

I just visited one state but 3 more states were shown to be visited

@giggity-hub
Copy link
Collaborator

This is because sveltekit is preloading the links on hover. If you hover over a link and refresh the site it will be shown as visited. I'll look into how to prevent setting visited on preload

giggity-hub added a commit that referenced this issue Sep 4, 2023
@giggity-hub
Copy link
Collaborator

The issue is that updating the visited state for a challenge is intertwined with fetching the challenge via "post_challenge". This way it is not possible to preload the challengeClass without marking it as visited.
Possible solutions would be:

  • Make fetching the challenge and updating the visited state two different endpoints. This way the visited state could be updated from the client side code and the challenge class still be preloaded (my favorite solution)
  • Pass a boolean parameter "markVisited" to the "post_challenge" endpoint (really hacky, do not recommend)
  • Disable preload for all challenge links (implemented right now)

@CloseChoice
Copy link
Owner Author

Refactor endpoints to have exactly one where for all things concerning the history of a challenge. So we should call this endpoint to update the states of the challenge to visited, tried and successful.

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

No branches or pull requests

2 participants