From 8df22b6ae0e783aa99f510304e3911b82f1033fb Mon Sep 17 00:00:00 2001 From: Jonas Tranberg Date: Mon, 20 May 2024 18:52:26 +0200 Subject: [PATCH] fix some compile errors for now --- src/components/Terminal/commands.ts | 8 +++++--- src/views/Login/Continue/index.tsx | 10 ++++------ src/views/Login/components/PlayerList.tsx | 6 ------ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/components/Terminal/commands.ts b/src/components/Terminal/commands.ts index 90d9d2b..acf3977 100644 --- a/src/components/Terminal/commands.ts +++ b/src/components/Terminal/commands.ts @@ -1,7 +1,7 @@ -import { Buffer, Command } from "./models"; import * as sounds from "../../hooks/sounds"; -import useGame from "../../stores/game"; import { getCardSuitName } from "../../models/card"; +import useGame from "../../stores/game"; +import { Buffer, Command } from "./models"; export const customCommands: Command[] = [ { @@ -37,7 +37,9 @@ export const customCommands: Command[] = [ switch (args[0]) { case "play": buffer.write("Playing sound..."); - sounds.play(args[1] as sounds.SoundName, args[2] === "--loop"); + sounds.play(args[1] as sounds.SoundName, { + loop: args[2] === "--loop", + }); break; case "stop": buffer.write("Stopping all sounds..."); diff --git a/src/views/Login/Continue/index.tsx b/src/views/Login/Continue/index.tsx index 150f897..065540b 100644 --- a/src/views/Login/Continue/index.tsx +++ b/src/views/Login/Continue/index.tsx @@ -14,15 +14,14 @@ import { import { FunctionComponent, useEffect, useState } from "react"; import { Helmet } from "react-helmet"; import { NavLink } from "react-router-dom"; -import PlayerItem from "../components/PlayerItem"; import * as GameAPI from "../../../api/endpoints/game"; -import { Player } from "../../../models/player"; -import { datetimeToddmmHHMMSS } from "../../../utilities/time"; import Conditional from "../../../components/Conditional"; +import { Player } from "../../../models/player"; import useGame from "../../../stores/game"; import { mapToLocal } from "../../../stores/game.mapper"; -import { stopAll } from "../../../hooks/sounds"; +import { datetimeToddmmHHMMSS } from "../../../utilities/time"; import ContinueGameDialog from "../components/ContinueGameDialog"; +import PlayerItem from "../components/PlayerItem"; const ContinueGameView: FunctionComponent = () => { const theme = useTheme(); @@ -65,7 +64,6 @@ const ContinueGameView: FunctionComponent = () => { return; } - stopAll(); Resume(mapToLocal(selectedGame)); }; @@ -112,7 +110,7 @@ const ContinueGameView: FunctionComponent = () => { { + onReady={async (p) => { setPlayer(p); }} onRemove={() => { diff --git a/src/views/Login/components/PlayerList.tsx b/src/views/Login/components/PlayerList.tsx index c4229b5..cbaeac6 100644 --- a/src/views/Login/components/PlayerList.tsx +++ b/src/views/Login/components/PlayerList.tsx @@ -27,8 +27,6 @@ const PlayerList: FunctionComponent = (props) => { return newPlayers; }); - - props.onChange?.(Object.values(newPlayers)); }, [props.numberOfPlayers]); return ( @@ -43,8 +41,6 @@ const PlayerList: FunctionComponent = (props) => { const newPlayers = { ...prev }; newPlayers[i] = p; - props.onChange?.(Object.values(newPlayers)); - return newPlayers; }); }} @@ -53,8 +49,6 @@ const PlayerList: FunctionComponent = (props) => { const newPlayers = { ...prev }; delete newPlayers[i]; - props.onChange?.(Object.values(newPlayers)); - return newPlayers; }); }}