closer
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { Accessor, createContext, createResource, Show } from "solid-js";
|
||||
import { GameState, Action } from "../../../server/src/games/simple";
|
||||
import {
|
||||
GameState,
|
||||
Action,
|
||||
vGameState,
|
||||
} from "../../../server/src/games/simple";
|
||||
import api from "../api";
|
||||
import Hand from "./Hand";
|
||||
import Pile from "./Pile";
|
||||
@@ -20,7 +24,7 @@ export default (props: { instanceId: string }) => {
|
||||
api
|
||||
.simple(props)
|
||||
.post({ action })
|
||||
.then((res) => mutate(res.data as GameState));
|
||||
.then((res) => res.status == 200 && mutate(res.data as vGameState));
|
||||
|
||||
return (
|
||||
<GameContext.Provider value={{ gameState, submitAction }}>
|
||||
@@ -38,7 +42,7 @@ export default (props: { instanceId: string }) => {
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<Hand hand={gameState.latest!.players[0]} />
|
||||
<Hand hand={gameState.latest!.players["daniel"]} />
|
||||
</div>
|
||||
</Show>
|
||||
</GameContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user