Skip to content

Commit

Permalink
Correct flash of wrong level after Getting Started (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty authored Mar 28, 2024
1 parent cacac12 commit 2fe8da3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ function App() {

// set the start level for a user who clicks beginner/expert
function setStartLevel(startLevel: LEVEL_NAMES) {
setCurrentLevel(startLevel);
openInformationOverlay();
if (currentLevel !== startLevel) {
// Changing level triggers info overlay: wait for that to avoid flash-of-wrong-level
setCurrentLevel(startLevel);
} else {
// Same level will not trigger info overlay, so must open manually
openInformationOverlay();
}
}

return (
Expand Down

0 comments on commit 2fe8da3

Please sign in to comment.