Skip to content

Commit

Permalink
update: working fix for bonds
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Dec 15, 2023
1 parent 7488e9d commit d154503
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/mixins/bonds.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const BondsMixin = (superclass) =>
class extends superclass {
constructor(config) {
super(config);
this.bondsGroup = new THREE.Group();
this.createBondsAsync();
this.isDrawBondsEnabled = false;
this.drawBonds = this.drawBonds.bind(this);
Expand All @@ -28,7 +27,6 @@ export const BondsMixin = (superclass) =>
const clsInstance = this;
clsInstance.areBondsCreated = false;
setTimeout(() => {
clsInstance.bondsGroup.clear();
clsInstance.bondsGroup = clsInstance.createBondsGroup();
clsInstance.areBondsCreated = true;
}, 10);
Expand Down Expand Up @@ -183,6 +181,7 @@ export const BondsMixin = (superclass) =>
* We need this to block the UI until the bonds are drawn.
*/
drawBonds() {
this.createBondsAsync();
if (!this.areBondsCreated) {
this.bondsGroup = this.createBondsGroup();
this.areBondsCreated = true;
Expand Down

0 comments on commit d154503

Please sign in to comment.