From 732274865df904f3a3208f98214eb40cfbe76973 Mon Sep 17 00:00:00 2001 From: Jiatong Yao Date: Mon, 17 Jun 2024 18:01:36 -0500 Subject: [PATCH] fix path for folder --- .../src/components/dialogs/CreatePrefabPanelDialog.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx b/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx index e6108ff7a0..c752a859f7 100644 --- a/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx +++ b/packages/editor/src/components/dialogs/CreatePrefabPanelDialog.tsx @@ -40,7 +40,7 @@ import { HeirarchyTreeNodeType } from '../hierarchy/HeirarchyTreeWalker' export default function CreatePrefabPanel({ node }: { node?: HeirarchyTreeNodeType }) { const entity = node?.entity as Entity - const defaultPrefabFolder = useHookstate('/assets/custom-prefabs') + const defaultPrefabFolder = useHookstate('assets/custom-prefabs') const prefabName = useHookstate('prefab') const prefabTag = useHookstate([]) const { t } = useTranslation() @@ -57,7 +57,7 @@ export default function CreatePrefabPanel({ node }: { node?: HeirarchyTreeNodeTy await exportRelativeGLTF(entity, srcProject, fileName) //pass tags to static resource const resources = await Engine.instance.api.service(staticResourcePath).find({ - query: { key: 'projects/' + srcProject + fileName } + query: { key: 'projects/' + srcProject + '/' + fileName } }) if (resources.data.length === 0) { throw new Error('User not found') @@ -66,7 +66,7 @@ export default function CreatePrefabPanel({ node }: { node?: HeirarchyTreeNodeTy const tags = [...prefabTag.value] await Engine.instance.api.service(staticResourcePath).patch(resource.id, { tags: tags }) PopoverState.hidePopupover() - defaultPrefabFolder.set('/assets/custom-prefabs') + defaultPrefabFolder.set('assets/custom-prefabs') prefabName.set('prefab') prefabTag.set([]) } catch (e) {