move history navigation (closes #9)

This commit is contained in:
Nathaniel Tampus
2023-03-12 19:54:22 +08:00
parent e2a0f361cf
commit 034ba1a206
3 changed files with 175 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
import type { Action, CustomSquares, Lobby, Message } from "@/types";
import type { Game, User } from "@chessu/types";
import type { Dispatch } from "react";
import type { Dispatch, SetStateAction } from "react";
import type { Socket } from "socket.io-client";
import { syncPgn, syncSide } from "./utils";
@@ -13,6 +13,8 @@ export function initSocket(
addMessage: Function;
updateCustomSquares: Dispatch<Partial<CustomSquares>>;
makeMove: Function;
setNavFen: Dispatch<SetStateAction<string | null>>;
setNavIndex: Dispatch<SetStateAction<number | null>>;
}
) {
socket.on("connect", () => {