From 3fa96681dd0bb443aed2edac13c92437985ebd8a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 5 Feb 2024 22:42:35 +0100 Subject: [PATCH] fix: remove duplicated on deployment management UI --- frontend/src/lib/components/DeployWorkspace.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/DeployWorkspace.svelte b/frontend/src/lib/components/DeployWorkspace.svelte index fc7064e766..5254130d86 100644 --- a/frontend/src/lib/components/DeployWorkspace.svelte +++ b/frontend/src/lib/components/DeployWorkspace.svelte @@ -68,13 +68,19 @@ } const allDeps = await getDependencies(kind, path) - for (const dep of allDeps) { + let sortedSet: { kind: Kind; path: string }[] = [] + allDeps.forEach((x) => { + if (!sortedSet.find((y) => y.kind == x.kind && y.path == x.path)) { + sortedSet.push(x) + } + }) + for (const dep of sortedSet) { allAlreadyExists[computeStatusPath(dep.kind, dep.path)] = await checkAlreadyExists( dep.kind, dep.path ) } - dependencies = allDeps.map((x) => ({ + dependencies = sortedSet.map((x) => ({ ...x, include: x.kind != 'variable' &&