diff --git a/src/useBlocklyWorkspace.ts b/src/useBlocklyWorkspace.ts index 4792b8f..c7b5db8 100644 --- a/src/useBlocklyWorkspace.ts +++ b/src/useBlocklyWorkspace.ts @@ -72,10 +72,10 @@ const useBlocklyWorkspace = ({ const toolboxConfigurationRef = React.useRef(toolboxConfiguration); React.useEffect(() => { toolboxConfigurationRef.current = toolboxConfiguration; - if (toolboxConfiguration && workspace) { + if (toolboxConfiguration && workspace && !workspaceConfiguration?.readOnly) { workspace.updateToolbox(toolboxConfiguration); } - }, [toolboxConfiguration, workspace]); + }, [toolboxConfiguration, workspace, workspaceConfiguration]); const onInjectRef = React.useRef(onInject); const onDisposeRef = React.useRef(onDispose);