Closed sdumetz closed 3 days ago
Do you have an example that triggers an issue with the current implementation? I think your change sounds fine, just trying to understand the issue a little better. Thanks!
It's triggered when you try to control the scene from an external script doing something like this :
let u = new URL(window.location.href);
u.searchParams.set("root","/scenes/foo");
voyager.reloadDocument();
Clearly not something voyager was made for, but it seems to work well enough with this small change, which is way better than adding a new public method just for this edge case.
Got it, thanks. Sounds good. Merged to https://github.com/Smithsonian/dpo-voyager/tree/rc-46
ExplorerApplication.evaluateProps()
won't yield the same result when run twice, becauseconst props = this.props
only references the original object, so down the line when we get the queryString values, it changes the values stored inthis.props
, thus potentially changing the result ofevaluateProps()
in unexpected ways.I think we should keep
this.props
unchanged or make it clear we intend to modify it by removing theconst props = this.props
assignment.I prefer the first solution as it's a one-line change and allows calling evaluateProps after a change in the page's queryString.