Skip to content

Commit ecb1c3a

Browse files
waleedlatif1claude
andcommitted
fix(blocks): clarify condition ID suffix slicing for readability
Use explicit hyphen separator instead of relying on slice offset to implicitly include the hyphen in the suffix, making the intent clearer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c939f8a commit ecb1c3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/sim/lib/workflows/condition-ids.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export function remapConditionBlockIds(
1919
const prefix = `${oldBlockId}-`
2020
for (const condition of conditions) {
2121
if (typeof condition.id === 'string' && condition.id.startsWith(prefix)) {
22-
const suffix = condition.id.slice(oldBlockId.length)
23-
condition.id = `${newBlockId}${suffix}`
22+
const suffix = condition.id.slice(prefix.length)
23+
condition.id = `${newBlockId}-${suffix}`
2424
changed = true
2525
}
2626
}
@@ -49,8 +49,8 @@ export function remapConditionEdgeHandle(
4949
const innerId = sourceHandle.slice(handlePrefix.length)
5050
if (!innerId.startsWith(`${oldBlockId}-`)) continue
5151

52-
const suffix = innerId.slice(oldBlockId.length)
53-
return `${handlePrefix}${newBlockId}${suffix}`
52+
const suffix = innerId.slice(oldBlockId.length + 1)
53+
return `${handlePrefix}${newBlockId}-${suffix}`
5454
}
5555

5656
return sourceHandle

0 commit comments

Comments
 (0)