Skip to content

Commit

Permalink
Merge pull request #214 from dojoengine/fix/state
Browse files Browse the repository at this point in the history
fix: bool state bug
  • Loading branch information
ponderingdemocritus authored Jun 15, 2024
2 parents 6858905 + 2a5fbab commit e047761
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: git submodule update --init --recursive

- run: curl -L https://install.dojoengine.org | bash
- run: /home/runner/.config/.dojo/bin/dojoup -v v0.7.0-alpha.5
- run: /home/runner/.config/.dojo/bin/dojoup -v v0.7.0
- run: |
cd examples/dojo-starter
/home/runner/.config/.dojo/bin/sozo build
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"create-components": "npx @dojoengine/core ../../dojo-starter/manifests/dev/manifest.json src/dojo/generated/contractComponents.ts http://localhost:5050 0x559e9e223d83b6a3121ba33b1339323a3bdf4c7c302078fb3e755fddc68a2fb"
"create-components": "npx @dojoengine/core ../../dojo-starter/manifests/dev/manifest.json src/dojo/generated/contractComponents.ts http://localhost:5050 0xb4079627ebab1cd3cf9fd075dda1ad2454a7a448bf659591f259efa2519b18"
},
"dependencies": {
"@dojoengine/core": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions examples/react/react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function App() {
const moves = useComponentValue(Moves, entityId);
const directions = useComponentValue(DirectionsAvailable, entityId);

console.log(moves);

const handleRestoreBurners = async () => {
try {
await account?.applyFromClipboard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export function defineContractComponents(world: World) {
player: RecsType.BigInt,
remaining: RecsType.Number,
last_direction: RecsType.Number,
can_move: RecsType.Boolean,
},
{
metadata: {
name: "Moves",
types: ["contractaddress", "u8", "enum"],
types: ["contractaddress", "u8", "enum", "bool"],
customTypes: ["Direction"],
},
}
Expand Down
2 changes: 0 additions & 2 deletions packages/state/src/recs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export const getEntities = async <S extends Schema>(
while (continueFetching) {
const entities = await client.getAllEntities(limit, cursor);

console.log("load entities", entities);

setEntities(entities, components);

if (Object.keys(entities).length < limit) {
Expand Down
1 change: 1 addition & 0 deletions packages/state/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function convertValues(schema: Schema, values: any) {

case RecsType.String:
case RecsType.BigInt:
case RecsType.Boolean:
case RecsType.Number:
acc[key] = value.value;
break;
Expand Down

0 comments on commit e047761

Please sign in to comment.