fix load projects
This commit is contained in:
parent
190d676e5b
commit
d835ffc449
@ -21,9 +21,8 @@ class BlocklyWindow extends Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
console.log(this.props);
|
||||
const workspace = Blockly.getMainWorkspace();
|
||||
|
||||
if (!this.props.initialXml) {
|
||||
if (this.props.workspaceXML !== "") {
|
||||
Blockly.Xml.clearWorkspaceAndLoadFromXml(
|
||||
Blockly.Xml.textToDom(this.props.workspaceXML),
|
||||
@ -33,6 +32,7 @@ class BlocklyWindow extends Component {
|
||||
this.props.onChangeWorkspace({});
|
||||
this.props.clearStats();
|
||||
}
|
||||
}
|
||||
workspace.addChangeListener((event) => {
|
||||
this.props.onChangeWorkspace(event);
|
||||
// switch on that a block is displayed disabled or not depending on whether it is correctly connected
|
||||
@ -47,8 +47,6 @@ class BlocklyWindow extends Component {
|
||||
componentDidUpdate(props) {
|
||||
const workspace = Blockly.getMainWorkspace();
|
||||
var xml = this.props.initialXml;
|
||||
console.log(xml)
|
||||
console.log(this.props.xml)
|
||||
// if svg is true, then the update process is done in the BlocklySvg component
|
||||
if (props.initialXml !== xml && !this.props.svg) {
|
||||
// guarantees that the current xml-code (this.props.initialXml) is rendered
|
||||
|
Loading…
x
Reference in New Issue
Block a user