From 8424ab7376bf5f1edf1cc6f8b7f7bc734624b656 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Mon, 9 Sep 2024 08:37:37 +0200 Subject: [PATCH] Update visibility icon in scene graph if you change the visible checkbox in right panel --- src/components/scenegraph/SceneGraph.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/scenegraph/SceneGraph.js b/src/components/scenegraph/SceneGraph.js index bb65e067..24b08c5d 100644 --- a/src/components/scenegraph/SceneGraph.js +++ b/src/components/scenegraph/SceneGraph.js @@ -36,8 +36,8 @@ export default class SceneGraph extends React.Component { ); } - onMixinUpdate = (detail) => { - if (detail.component === 'mixin') { + onEntityUpdate = (detail) => { + if (detail.component === 'mixin' || detail.component === 'visible') { this.rebuildEntityOptions(); } }; @@ -47,14 +47,14 @@ export default class SceneGraph extends React.Component { Events.on('entityidchange', this.rebuildEntityOptions); Events.on('entitycreated', this.rebuildEntityOptions); Events.on('entityclone', this.rebuildEntityOptions); - Events.on('entityupdate', this.onMixinUpdate); + Events.on('entityupdate', this.onEntityUpdate); } componentWillUnmount() { Events.off('entityidchange', this.rebuildEntityOptions); Events.off('entitycreated', this.rebuildEntityOptions); Events.off('entityclone', this.rebuildEntityOptions); - Events.off('entityupdate', this.onMixinUpdate); + Events.off('entityupdate', this.onEntityUpdate); } /**