Skip to content

Commit

Permalink
Merge pull request #30 from concord-consortium/187321098-fix-pause-st…
Browse files Browse the repository at this point in the history
…ep-to-use-same-sequence

fix: Pause + Step to use the same sequence [PT-187321098]
  • Loading branch information
dougmartin authored Apr 2, 2024
2 parents 9756928 + 2aca027 commit fa17fba
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 fa17fba

Please sign in to comment.