Fix auto play label and first step behavior
- Change initial play button label from Resume to Auto Play - Ensure first step opens a single box when manually stepping - Adjust logic to start from an initial idle state (-1) to align with expected behavior X-Lovable-Edit-ID: edt-70f04cee-2de9-4621-9009-66a571a91a4f
This commit is contained in:
commit
6450824c73
1 changed files with 2 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ const PresentsPuzzle = ({
|
||||||
const [aliceFound, setAliceFound] = useState(0);
|
const [aliceFound, setAliceFound] = useState(0);
|
||||||
const [bobFound, setBobFound] = useState(0);
|
const [bobFound, setBobFound] = useState(0);
|
||||||
const [isRunning, setIsRunning] = useState(false);
|
const [isRunning, setIsRunning] = useState(false);
|
||||||
const [currentStep, setCurrentStep] = useState(0);
|
const [currentStep, setCurrentStep] = useState(-1);
|
||||||
const [aliceOrder, setAliceOrder] = useState<number[]>([]);
|
const [aliceOrder, setAliceOrder] = useState<number[]>([]);
|
||||||
const [bobOrder, setBobOrder] = useState<number[]>([]);
|
const [bobOrder, setBobOrder] = useState<number[]>([]);
|
||||||
const [winner, setWinner] = useState<'alice' | 'bob' | 'tie' | null>(null);
|
const [winner, setWinner] = useState<'alice' | 'bob' | 'tie' | null>(null);
|
||||||
|
|
@ -406,7 +406,7 @@ const PresentsPuzzle = ({
|
||||||
className="gap-2"
|
className="gap-2"
|
||||||
>
|
>
|
||||||
<Play className="w-4 h-4" />
|
<Play className="w-4 h-4" />
|
||||||
{currentStep === -1 ? 'Start' : 'Resume'}
|
{currentStep === -1 ? 'Auto Play' : 'Resume'}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={pauseSimulation}
|
onClick={pauseSimulation}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue