From 69042d254247da5ceacfa4c89a8d6dea54578c4d Mon Sep 17 00:00:00 2001 From: ponderingdemocritus Date: Fri, 30 Aug 2024 16:52:50 -0400 Subject: [PATCH] fix: prettier --- .../models/dojo_starter-DirectionsAvailable-77844f1f.toml | 1 + .../dev/base/models/dojo_starter-Moved-504403e5.toml | 1 + .../dev/base/models/dojo_starter-Moves-2a29373f.toml | 1 + .../dev/base/models/dojo_starter-Position-2ac8b4c1.toml | 1 + .../dojo-starter/manifests/dev/deployment/manifest.json | 4 ++++ .../dojo-starter/manifests/dev/deployment/manifest.toml | 4 ++++ packages/state/src/utils/index.ts | 7 ++++++- 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-DirectionsAvailable-77844f1f.toml b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-DirectionsAvailable-77844f1f.toml index 24e789b0..15804fda 100644 --- a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-DirectionsAvailable-77844f1f.toml +++ b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-DirectionsAvailable-77844f1f.toml @@ -3,6 +3,7 @@ class_hash = "0x72c6666cfeebc41544f502cfe9c32ad7b91fce12881709420335794dfcb324a" original_class_hash = "0x72c6666cfeebc41544f502cfe9c32ad7b91fce12881709420335794dfcb324a" abi = "manifests/dev/base/abis/models/dojo_starter-DirectionsAvailable-77844f1f.json" tag = "dojo_starter-DirectionsAvailable" +qualified_path = "dojo_starter::models::directions_available" manifest_name = "dojo_starter-DirectionsAvailable-77844f1f" [[members]] diff --git a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moved-504403e5.toml b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moved-504403e5.toml index 51e65ba5..6ac93301 100644 --- a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moved-504403e5.toml +++ b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moved-504403e5.toml @@ -3,6 +3,7 @@ class_hash = "0x2e06be7cf406eb3161fedf460a47faca68855eb9dad7d505c1b1f1875192ccd" original_class_hash = "0x2e06be7cf406eb3161fedf460a47faca68855eb9dad7d505c1b1f1875192ccd" abi = "manifests/dev/base/abis/models/dojo_starter-Moved-504403e5.json" tag = "dojo_starter-Moved" +qualified_path = "dojo_starter::systems::actions::actions::moved" manifest_name = "dojo_starter-Moved-504403e5" [[members]] diff --git a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml index eff7364d..2eda38b9 100644 --- a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml +++ b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Moves-2a29373f.toml @@ -3,6 +3,7 @@ class_hash = "0x4eac0db062821cc05485ba088b0bb748de83e901116216da171744dfc5ec6fa" original_class_hash = "0x4eac0db062821cc05485ba088b0bb748de83e901116216da171744dfc5ec6fa" abi = "manifests/dev/base/abis/models/dojo_starter-Moves-2a29373f.json" tag = "dojo_starter-Moves" +qualified_path = "dojo_starter::models::moves" manifest_name = "dojo_starter-Moves-2a29373f" [[members]] diff --git a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Position-2ac8b4c1.toml b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Position-2ac8b4c1.toml index 064246cb..5d837016 100644 --- a/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Position-2ac8b4c1.toml +++ b/examples/dojo/dojo-starter/manifests/dev/base/models/dojo_starter-Position-2ac8b4c1.toml @@ -3,6 +3,7 @@ class_hash = "0x6531637b0bbd741f8823b127d8958ed10a483dd1f2d7654975c1d7d7cbdab65" original_class_hash = "0x6531637b0bbd741f8823b127d8958ed10a483dd1f2d7654975c1d7d7cbdab65" abi = "manifests/dev/base/abis/models/dojo_starter-Position-2ac8b4c1.json" tag = "dojo_starter-Position" +qualified_path = "dojo_starter::models::position" manifest_name = "dojo_starter-Position-2ac8b4c1" [[members]] diff --git a/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.json b/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.json index 8d0bd80d..b3c92df3 100644 --- a/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.json +++ b/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.json @@ -1979,6 +1979,7 @@ } ], "tag": "dojo_starter-DirectionsAvailable", + "qualified_path": "dojo_starter::models::directions_available", "manifest_name": "dojo_starter-DirectionsAvailable-77844f1f" }, { @@ -2431,6 +2432,7 @@ } ], "tag": "dojo_starter-Moved", + "qualified_path": "dojo_starter::systems::actions::actions::moved", "manifest_name": "dojo_starter-Moved-504403e5" }, { @@ -2915,6 +2917,7 @@ } ], "tag": "dojo_starter-Moves", + "qualified_path": "dojo_starter::models::moves", "manifest_name": "dojo_starter-Moves-2a29373f" }, { @@ -3355,6 +3358,7 @@ } ], "tag": "dojo_starter-Position", + "qualified_path": "dojo_starter::models::position", "manifest_name": "dojo_starter-Position-2ac8b4c1" } ] diff --git a/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.toml b/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.toml index e12d9340..bca467c3 100644 --- a/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.toml +++ b/examples/dojo/dojo-starter/manifests/dev/deployment/manifest.toml @@ -48,6 +48,7 @@ class_hash = "0x72c6666cfeebc41544f502cfe9c32ad7b91fce12881709420335794dfcb324a" original_class_hash = "0x72c6666cfeebc41544f502cfe9c32ad7b91fce12881709420335794dfcb324a" abi = "manifests/dev/deployment/abis/models/dojo_starter-DirectionsAvailable-77844f1f.json" tag = "dojo_starter-DirectionsAvailable" +qualified_path = "dojo_starter::models::directions_available" manifest_name = "dojo_starter-DirectionsAvailable-77844f1f" [[models.members]] @@ -66,6 +67,7 @@ class_hash = "0x2e06be7cf406eb3161fedf460a47faca68855eb9dad7d505c1b1f1875192ccd" original_class_hash = "0x2e06be7cf406eb3161fedf460a47faca68855eb9dad7d505c1b1f1875192ccd" abi = "manifests/dev/deployment/abis/models/dojo_starter-Moved-504403e5.json" tag = "dojo_starter-Moved" +qualified_path = "dojo_starter::systems::actions::actions::moved" manifest_name = "dojo_starter-Moved-504403e5" [[models.members]] @@ -84,6 +86,7 @@ class_hash = "0x4eac0db062821cc05485ba088b0bb748de83e901116216da171744dfc5ec6fa" original_class_hash = "0x4eac0db062821cc05485ba088b0bb748de83e901116216da171744dfc5ec6fa" abi = "manifests/dev/deployment/abis/models/dojo_starter-Moves-2a29373f.json" tag = "dojo_starter-Moves" +qualified_path = "dojo_starter::models::moves" manifest_name = "dojo_starter-Moves-2a29373f" [[models.members]] @@ -112,6 +115,7 @@ class_hash = "0x6531637b0bbd741f8823b127d8958ed10a483dd1f2d7654975c1d7d7cbdab65" original_class_hash = "0x6531637b0bbd741f8823b127d8958ed10a483dd1f2d7654975c1d7d7cbdab65" abi = "manifests/dev/deployment/abis/models/dojo_starter-Position-2ac8b4c1.json" tag = "dojo_starter-Position" +qualified_path = "dojo_starter::models::position" manifest_name = "dojo_starter-Position-2ac8b4c1" [[models.members]] diff --git a/packages/state/src/utils/index.ts b/packages/state/src/utils/index.ts index 1cbcddaf..a52bb0fe 100644 --- a/packages/state/src/utils/index.ts +++ b/packages/state/src/utils/index.ts @@ -20,7 +20,12 @@ export function convertValues(schema: Schema, values: any) { switch (schemaType) { case RecsType.StringArray: - if (value.type === "array" && value.value[0].type === "enum") { + if (value.type === "array" && value.value.length === 0) { + acc[key] = []; + } else if ( + value.type === "array" && + value.value[0].type === "enum" + ) { acc[key] = value.value.map( (item: any) => item.value.option );