Code edited so that it automatically fetches scramble when switched to session with loading message
Current issue is the fact that when you queue the scramble (by switching to a new event like 4x4) and quickly switch to new session during the loading, the new session’s scramble is replaced with the queued scramble, no matter whether or not the new scramble needs to be replaced. This even occurs when the scramble types are not the same.
Proposed fix: make it so that setScramble accepts a session parameter that sets the scramble for that session and that session only. This will fix the issue of queuing.
Advanced implementation: if session parameter not provided, then just use the default session. However, because of async and sync issues, it doesn’t work with purely that. We need to pass on the session parameter directly from wherever we are calling setScramble from the outside.
When scramble is loading, and you reload the page, it is stuck on the "Fetching scramble..." text.