diff --git a/frontend/src/components/prompts/CreateFilePath.vue b/frontend/src/components/prompts/CreateFilePath.vue index 9636b6cc..ec470f3a 100644 --- a/frontend/src/components/prompts/CreateFilePath.vue +++ b/frontend/src/components/prompts/CreateFilePath.vue @@ -41,12 +41,11 @@ const container = ref(null); const path = computed(() => { let basePath = fileStore.isFiles ? route.path : url.removeLastDir(route.path); + if (!basePath.endsWith("/")) { + basePath += "/"; + } basePath += props.name; - - return basePath - .replace(/^\/[^\/]+/, "") - .split("/") - .filter(Boolean); + return basePath.split("/").filter(Boolean).splice(1); }); watch(path, () => {