Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run all archived messages when embedded widget is uninitialized #1064
Run all archived messages when embedded widget is uninitialized #1064
Changes from 2 commits
42b70bf
2434ffa
7fa3335
349a783
a7a52d9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check for
ngl_stage_params
instead?in another line:
var ngl_stage_params = that.model.get('_ngl_full_stage_parameters');
Basically if the ngl is not initialize, check for empty of something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or check for both
ngl_full_stage_parameters
and_camera_orientation
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! It looks
_ngl_full_stage_parameters
object is already modified increateStage
, so I've just made this a shallow copy so that changes aren't reflected in the shared state until we deliberately sync them back up. I think this is more robust to future changes than checking if_ngl_full_stage_parameters
is the value it is modified to.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should update
await
for other places usingon_msg(msg)
too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhmmm possibly. I didn't make this sort of change to avoid changing behaviour. The other places calling
on_msg
are:l450 (in
handleEmbed()
):This should probably be
await
ed - it's in an async function already and its possible that_set_representation_from_repr_dict
could try to set a representation on a component added here? The comment above_set_representation_from_repr_dict
seems to suggest that completing all these messages is a requirement, and completing them out of order could mean assigning the wrong representations. (I will make this change shortly)l152 (in
handleMessage
):From what I can google, ipywidgets/backbone don't seem to treat async callbacks any different to regular callbacks, so making the callback function async and adding an await here wouldn't do anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. thanks.