Compare commits

...

2 Commits

Author SHA1 Message Date
Vikhyath Mondreti
0fb6d9d451 remove comments 2026-01-13 00:38:42 -08:00
Vikhyath Mondreti
77241a1220 fix 2026-01-13 00:36:12 -08:00

View File

@@ -1088,25 +1088,28 @@ export function useCollaborativeWorkflow() {
userId: session?.user?.id || 'unknown',
})
const currentValue = subBlockStore.getValue(blockId, subblockId)
const valueActuallyChanged = currentValue !== value
subBlockStore.setValue(blockId, subblockId, value)
try {
const visited = options?._visited || new Set<string>()
if (visited.has(subblockId)) return
visited.add(subblockId)
const blockType = useWorkflowStore.getState().blocks?.[blockId]?.type
const blockConfig = blockType ? getBlock(blockType) : null
if (blockConfig?.subBlocks && Array.isArray(blockConfig.subBlocks)) {
const dependents = blockConfig.subBlocks.filter(
(sb: any) => Array.isArray(sb.dependsOn) && sb.dependsOn.includes(subblockId)
)
for (const dep of dependents) {
if (!dep?.id || dep.id === subblockId) continue
collaborativeSetSubblockValue(blockId, dep.id, '', { _visited: visited })
if (valueActuallyChanged) {
try {
const visited = options?._visited || new Set<string>()
if (visited.has(subblockId)) return
visited.add(subblockId)
const blockType = useWorkflowStore.getState().blocks?.[blockId]?.type
const blockConfig = blockType ? getBlock(blockType) : null
if (blockConfig?.subBlocks && Array.isArray(blockConfig.subBlocks)) {
const dependents = blockConfig.subBlocks.filter(
(sb: any) => Array.isArray(sb.dependsOn) && sb.dependsOn.includes(subblockId)
)
for (const dep of dependents) {
if (!dep?.id || dep.id === subblockId) continue
collaborativeSetSubblockValue(blockId, dep.id, '', { _visited: visited })
}
}
}
} catch {
// Best-effort; do not block on clearing
} catch {}
}
},
[