let data = JSON.parse(message.data);
if (data.uid == nid) {
console.log("discarding");
return;
}
console.log(message, "recieved")
let ogTarget = this.props.vm.editingTarget;
this.props.vm.editingTarget = this.props.vm.runtime.getSpriteTargetByName(data.target);
this.props.vm.runtime._editingTarget = this.props.vm.editingTarget;
const event = this.ScratchBlocks.Events.fromJson(data.event, this.workspace);
const qselect = document.querySelector('.blocklyWorkspace');
try {
stopEmission = true;
if (!!qselect) {
console.log(event.workspaceId);
console.log(this.workspace.id);
event.run(true);
} else {
let vevent = data.ogevent;
vevent.xml = data.xml;
this.props.vm.editingTarget.blocks.blocklyListen(vevent);
}
} catch (e) {
console.error(e);
}
this.props.vm.editingTarget = ogTarget;
this.props.vm.runtime._editingTarget = this.props.vm.editingTarget;
stopEmission = false;