Skip to content

Commit

Permalink
fix: 🔥 Slider set to last move after editing scramble. Not necessary …
Browse files Browse the repository at this point in the history
…but Aditya Needs it.
  • Loading branch information
senorbeast committed Mar 5, 2022
1 parent e615308 commit 8f28f57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/CubeD/UX/Scramble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Typography } from '@material-ui/core';
import { useEffect } from 'react';
import { ScrambleI, InTextArea1 } from './CubeElements';
import selMode from './modes';
import { useScra, useSetScra, useSol } from '../AlgProvider';

import { useScra, useSetScra, useSol, useSetMoveNum } from '../AlgProvider';
import getAlgs from '../Parser/getAlgs';
import validateAlgs from '../Parser/validateAlg';
interface propsM {
mode: string;
}
Expand All @@ -12,6 +13,8 @@ const Scramble = ({ mode }: propsM) => {
let newScra = useScra();
let newSol = useSol();
let setScra = useSetScra();
let setCMovNum = useSetMoveNum();

useEffect(() => {
if (newScra != undefined) {
console.log('URL useEffect');
Expand Down Expand Up @@ -45,6 +48,7 @@ const Scramble = ({ mode }: propsM) => {
var Scra = event.target.value;
//setnewScra(Scra);
setScra(Scra);
setCMovNum(validateAlgs(getAlgs(newSol)).movesNum);
//handleScra(Scra);
}
};
Expand Down

0 comments on commit 8f28f57

Please sign in to comment.