Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bool state bug #214

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading