mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Fixed block deletion bug
This commit is contained in:
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { useBlockConnections } from '@/app/w/hooks/use-block-connections'
|
||||
import { Card } from '@/components/ui/card'
|
||||
|
||||
interface ConnectionBlockProps {
|
||||
interface ConnectionBlocksProps {
|
||||
blockId: string
|
||||
}
|
||||
|
||||
export function ConnectionBlock({ blockId }: ConnectionBlockProps) {
|
||||
export function ConnectionBlocks({ blockId }: ConnectionBlocksProps) {
|
||||
const { incomingConnections, hasIncomingConnections } =
|
||||
useBlockConnections(blockId)
|
||||
|
||||
@@ -4,7 +4,7 @@ import { SubBlock } from './components/sub-block/sub-block'
|
||||
import { Handle, Position } from 'reactflow'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ActionBar } from './components/action-bar/action-bar'
|
||||
import { ConnectionBlock } from './components/connection-block/connection-block'
|
||||
import { ConnectionBlocks } from './components/connection-blocks/connection-blocks'
|
||||
|
||||
interface WorkflowBlockProps {
|
||||
id: string
|
||||
@@ -53,7 +53,7 @@ export function WorkflowBlock({
|
||||
return (
|
||||
<Card className="w-[320px] shadow-md select-none group relative cursor-default">
|
||||
{selected && <ActionBar blockId={id} />}
|
||||
<ConnectionBlock blockId={id} />
|
||||
<ConnectionBlocks blockId={id} />
|
||||
|
||||
<Handle
|
||||
type="target"
|
||||
|
||||
@@ -32,8 +32,9 @@ export const useWorkflowStore = create<WorkflowStoreWithHistory>()(
|
||||
updateSubBlock: (blockId: string, subBlockId: string, value: any) => {
|
||||
set((state) => {
|
||||
const block = state.blocks[blockId]
|
||||
const blockConfig = getBlock(block.type)
|
||||
if (!block) return state
|
||||
|
||||
const blockConfig = getBlock(block.type)
|
||||
if (!blockConfig) return state
|
||||
|
||||
// Create new subBlocks state
|
||||
|
||||
Reference in New Issue
Block a user