mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Merge pull request #549 from simstudioai/fix/workspace-undefined
fix: workspace undefined
This commit is contained in:
@@ -408,12 +408,6 @@ export function WorkflowBlock({ id, data }: NodeProps<WorkflowBlockProps>) {
|
||||
}
|
||||
|
||||
const shouldShowScheduleBadge = isStarterBlock && !isLoadingScheduleInfo && scheduleInfo !== null
|
||||
|
||||
const workflowId = useWorkflowRegistry((state) => state.activeWorkflowId)
|
||||
const currentWorkflow = useWorkflowRegistry((state) =>
|
||||
workflowId ? state.workflows[workflowId] : null
|
||||
)
|
||||
const workspaceId = currentWorkflow?.workspaceId || null
|
||||
const userPermissions = useUserPermissionsContext()
|
||||
|
||||
return (
|
||||
|
||||
@@ -92,8 +92,9 @@ const WorkflowContent = React.memo(() => {
|
||||
const router = useRouter()
|
||||
const { project, getNodes, fitView } = useReactFlow()
|
||||
|
||||
// Get workspace ID from current workflow
|
||||
const workflowId = params.workflowId as string
|
||||
// Get workspace ID from the params
|
||||
const workspaceId = params.workspaceId as string
|
||||
|
||||
const { workflows, activeWorkflowId, isLoading, setActiveWorkflow, createWorkflow } =
|
||||
useWorkflowRegistry()
|
||||
|
||||
@@ -103,9 +104,6 @@ const WorkflowContent = React.memo(() => {
|
||||
updateNodeDimensions,
|
||||
updateBlockPosition: storeUpdateBlockPosition,
|
||||
} = useWorkflowStore()
|
||||
// Use collaborative operations for real-time sync
|
||||
const currentWorkflow = useMemo(() => workflows[workflowId], [workflows, workflowId])
|
||||
const workspaceId = currentWorkflow?.workspaceId
|
||||
|
||||
// User permissions - get current user's specific permissions from context
|
||||
const userPermissions = useUserPermissionsContext()
|
||||
|
||||
Reference in New Issue
Block a user