Skip to content

Commit f32ad77

Browse files
Filter out sceneOnly components when selected entity is not a-scene (#811)
1 parent 62b0b3f commit f32ad77

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/components/AddComponent.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@ export default class AddComponent extends React.Component {
6464
getComponentsOptions() {
6565
const usedComponents = Object.keys(this.props.entity.components);
6666
return Object.keys(AFRAME.components)
67-
.filter(function (componentName) {
67+
.filter((componentName) => {
68+
if (
69+
AFRAME.components[componentName].sceneOnly &&
70+
!this.props.entity.isScene
71+
) {
72+
return false;
73+
}
74+
6875
return (
6976
AFRAME.components[componentName].multiple ||
7077
usedComponents.indexOf(componentName) === -1

0 commit comments

Comments
 (0)