Ensure Details guide animations work
This commit is contained in:
1 parent
a66fbc2fa9
commit
f1304bd028
1 file changed
+4
-3
@@ -24,8 +24,9 @@ export default function TraceRunner({ meta, steps, loggedIn, username, completed
|
||||
const router = useRouter();
|
||||
const lastIndex = steps.length - 1;
|
||||
const [idx, setIdx] = useState(Math.min(completedSteps.length, lastIndex));
|
||||
const [finished, setFinished] = useState(alreadyEarned);
|
||||
const [earned, setEarned] = useState(alreadyEarned);
|
||||
// Always open the lesson (so you can redraw/continue); show the finished screen only after finishing here.
|
||||
const [finished, setFinished] = useState(false);
|
||||
const [earned, setEarned] = useState(false);
|
||||
const [playKey, setPlayKey] = useState(0);
|
||||
const [playing, setPlaying] = useState(true);
|
||||
const [finalImage, setFinalImage] = useState<string | null>(null);
|
||||
@@ -71,7 +72,7 @@ export default function TraceRunner({ meta, steps, loggedIn, username, completed
|
||||
useEffect(() => { if (!finished) resize(); }, [finished, resize]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loggedIn || alreadyEarned) return; let alive = true;
|
||||
if (!loggedIn) return; let alive = true;
|
||||
loadProgressDrawing(meta.level, meta.sublevel).then((img) => {
|
||||
// Use this lesson's own saved canvas if any; otherwise carry over the previous lesson's drawing
|
||||
const src = img || carryImage;
|
||||
|
||||
Reference in new issue
Block a user