feat : add progress bar
This commit is contained in:
@@ -4,6 +4,7 @@ import { useChessActions } from "@/hooks/useChessActions";
|
||||
import {
|
||||
boardAtom,
|
||||
boardOrientationAtom,
|
||||
evaluationProgressAtom,
|
||||
gameAtom,
|
||||
gameEvalAtom,
|
||||
} from "../states";
|
||||
@@ -20,6 +21,7 @@ export default function LoadGame() {
|
||||
const { gameFromUrl } = useGameDatabase();
|
||||
const setEval = useSetAtom(gameEvalAtom);
|
||||
const setBoardOrientation = useSetAtom(boardOrientationAtom);
|
||||
const evaluationProgress = useAtomValue(evaluationProgressAtom);
|
||||
|
||||
const resetAndSetGamePgn = useCallback(
|
||||
(pgn: string) => {
|
||||
@@ -48,6 +50,8 @@ export default function LoadGame() {
|
||||
|
||||
const isGameLoaded = gameFromUrl !== undefined || !!game.header().White;
|
||||
|
||||
if (evaluationProgress) return null;
|
||||
|
||||
return (
|
||||
<LoadGameButton
|
||||
label={isGameLoaded ? "Load another game" : "Load game"}
|
||||
|
||||
Reference in New Issue
Block a user