Skip to content

Commit

Permalink
fix setAttribute street-environment, second param is mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Aug 31, 2024
1 parent 5eaa12c commit 04dc429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/street-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function newScene(
'Environment'
);
environmentEl.removeAttribute('street-environment');
environmentEl.setAttribute('street-environment');
environmentEl.setAttribute('street-environment', '');
const geoLayer = checkOrCreateEntity(
'reference-layers',
AFRAME.scenes[0],
Expand Down

2 comments on commit 04dc429

@kfarr
Copy link
Collaborator

@kfarr kfarr commented on 04dc429 Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vincentfretin this causes an error when loading a scene with color preset, the default sky is shown instead of the color.

The value of the component seems to be correctly set to color but the sky is still showing instead of the color. My hypothesis is that it is a race condition that adding an image and color at basically the same time results in only the image being shown (since they run immediately after each other -- once for default of sky and then the sky from the scene)

Thoughts?

@vincentfretin
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I reproduced the issue switching the network speed to 3G. A better fix is just to ignore the loaded texture in this case. I committed the fix.

Please sign in to comment.