🎐 fixed the pin removing bug (hopefully) 🍋

This commit is contained in:
Matei Adriel 2019-06-04 13:07:01 +00:00
parent 731ceb6cd2
commit 1db7a58aee

View file

@ -126,30 +126,15 @@ export class Component {
} }
else if (e.button === 2) { else if (e.button === 2) {
// setTimeout(() => {
console.log("removed")
manager.components = manager.components.filter(({ id }) => id !== this.id) manager.components = manager.components.filter(({ id }) => id !== this.id)
manager.update()
manager.wireManager.wires manager.wireManager.wires
.filter(val => val.input.of.id == this.id || val.output.of.id == this.id) .filter(val => val.input.of.id == this.id || val.output.of.id == this.id)
.forEach(val => { .forEach(val => {
manager.wireManager.remove(val) manager.wireManager.remove(val)
}) })
// manager.to
console.log("removed 1")
manager.wireManager.update.next(true) manager.wireManager.update.next(true)
console.log("removed 2")
manager.update() manager.update()
console.log("removed 3")
console.log(manager.components)
console.log(manager.wireManager)
// }, 0)
} }
} }