mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(tags): only show start block upstream if is ancestor (#2013)
This commit is contained in:
committed by
GitHub
parent
c25ea5c677
commit
fca92a7499
@@ -30,7 +30,7 @@ export function useAccessibleReferencePrefixes(blockId?: string | null): Set<str
|
||||
const starterBlock = Object.values(blocks).find(
|
||||
(block) => block.type === 'starter' || block.type === 'start_trigger'
|
||||
)
|
||||
if (starterBlock) {
|
||||
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
|
||||
accessibleIds.add(starterBlock.id)
|
||||
}
|
||||
|
||||
|
||||
@@ -85,9 +85,10 @@ export class BlockPathCalculator {
|
||||
const pathNodes = BlockPathCalculator.findAllPathNodes(workflow.connections, block.id)
|
||||
pathNodes.forEach((nodeId) => accessibleBlocks.add(nodeId))
|
||||
|
||||
// Always allow referencing the starter block (special case)
|
||||
// Only add starter block if it's actually upstream (already in pathNodes)
|
||||
// Don't add it just because it exists on the canvas
|
||||
const starterBlock = workflow.blocks.find((b) => b.metadata?.id === 'starter')
|
||||
if (starterBlock && starterBlock.id !== block.id) {
|
||||
if (starterBlock && starterBlock.id !== block.id && pathNodes.includes(starterBlock.id)) {
|
||||
accessibleBlocks.add(starterBlock.id)
|
||||
}
|
||||
|
||||
|
||||
@@ -592,7 +592,9 @@ export class Serializer {
|
||||
const accessibleIds = new Set<string>(ancestorIds)
|
||||
accessibleIds.add(blockId)
|
||||
|
||||
if (starterBlock) {
|
||||
// Only add starter block if it's actually upstream (already in ancestorIds)
|
||||
// Don't add it just because it exists on the canvas
|
||||
if (starterBlock && ancestorIds.includes(starterBlock.id)) {
|
||||
accessibleIds.add(starterBlock.id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user