Skip to content

Commit

Permalink
fix: Pause + Step to use the same sequence [PT-187321098]
Browse files Browse the repository at this point in the history
Also fixed misspelled stepping type value.
  • Loading branch information
dougmartin committed Apr 1, 2024
1 parent 9756928 commit 2aca027
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Drawing } from "./drawing";

import "./app.scss";

type GenerationMode = "ready" | "playing" | "paused" | "steping";
type GenerationMode = "ready" | "playing" | "paused" | "stepping";

const AnyStartingState = "(any)";
const MaxLengthLimit = 25;
Expand Down Expand Up @@ -233,8 +233,8 @@ export const App = () => {
}, [finishAnimating, startAnimationInterval]);

const handleStep = useCallback(async () => {
if (generationMode !== "steping") {
setGenerationMode("steping");
if ((generationMode !== "stepping") && (generationMode !== "paused")) {
setGenerationMode("stepping");
await generateNewSequence();
animateCurrentSequenceIndex();
} else if (currentSequenceAnimating()) {
Expand Down Expand Up @@ -297,7 +297,7 @@ export const App = () => {
<button
type="button"
onClick={onPlayClick}
disabled={disabled || lengthLimit === undefined || generationMode === "steping"}>
disabled={disabled || lengthLimit === undefined || generationMode === "stepping"}>
{playLabel}
</button>
<button
Expand Down

0 comments on commit 2aca027

Please sign in to comment.