diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte b/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte index aba12b035b..8da2263a21 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte +++ b/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte @@ -56,7 +56,10 @@ function addComponent(appComponent: AppComponent) { $dirtyStore = true const grid = $app.grid ?? [] - const id = getNextId(grid.map((gridItem) => gridItem.data.id)) + const id = getNextId( + grid.map((gridItem) => gridItem.data.id), + true + ) appComponent.id = id diff --git a/frontend/src/lib/components/flows/flowStateUtils.ts b/frontend/src/lib/components/flows/flowStateUtils.ts index f7f3415720..c3ddae7aa7 100644 --- a/frontend/src/lib/components/flows/flowStateUtils.ts +++ b/frontend/src/lib/components/flows/flowStateUtils.ts @@ -32,7 +32,7 @@ export async function loadFlowModuleState(flowModule: FlowModule): Promise { if (key === 'failure' || key.includes('branch') || key.includes('loop')) { return acc diff --git a/frontend/src/lib/components/flows/utils.ts b/frontend/src/lib/components/flows/utils.ts index b4cd7350ef..7db5571116 100644 --- a/frontend/src/lib/components/flows/utils.ts +++ b/frontend/src/lib/components/flows/utils.ts @@ -179,7 +179,7 @@ export function emptyFlowModuleState(): FlowModuleState { const aCharCode = 'a'.charCodeAt(0) -export function numberToChars(n: number) { +export function numberToChars(n: number, skipTilde: boolean = false) { var b = [n], sp, out, @@ -187,11 +187,12 @@ export function numberToChars(n: number) { div sp = 0 + const basisInc = skipTilde ? -1 : 0 while (sp < b.length) { - if (b[sp] > 25) { - div = Math.floor(b[sp] / 27) + if (b[sp] > (25 + basisInc)) { + div = Math.floor(b[sp] / (27 + basisInc)) b[sp + 1] = div - 1 - b[sp] %= 27 + b[sp] %= (27 + basisInc) } sp += 1 }