From 67bfa638612fedb219c431627d0531c2b0bef235 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Sat, 5 Nov 2022 14:43:07 +0000 Subject: [PATCH] stripping - from additional app name number --- packages/builder/src/pages/builder/portal/apps/index.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 04b7619412..4ca67d83be 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -167,11 +167,13 @@ const autoCreateApp = async () => { try { // Auto name app if has same name - let appName = template.key.replace("app/", "") + const templateKey = template.key.split("/")[1] + + let appName = templateKey.replace(/-/g, " ") const appsWithSameName = $apps.filter(app => app.name?.startsWith(appName) ) - appName = `${appName}-${appsWithSameName.length + 1}` + appName = `${appName} ${appsWithSameName.length + 1}` // Create form data to create app let data = new FormData()