-
Notifications
You must be signed in to change notification settings - Fork 9
CT-518 add charm on navigateTo in jumble #1343
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
Conversation
we were creating the charm cells improperly (a second charm would share cells with the first due to cause naming) - additionally navigate shouldn't navigate if it returns undefined
| return this.charms; | ||
| } | ||
|
|
||
| private async add(newCharms: Cell<Charm>[]) { |
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.
@jsantell given your (upcoming) work on internal charm apis/functions, this should probably be considered
an action in jumble can mean "actually, you know this charm, plz remember it for me!)
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.
cubic found 2 issues across 6 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.
| } | ||
|
|
||
| runtime.navigateCallback(target); | ||
| if (target && target.get()) { |
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.
The check target.get() assumes that target is an object with a get method, but there is no type guard to ensure target has a get function. This could throw a runtime error if target is not the expected type.
| if (target && target.get()) { | |
| if (target && typeof target.get === 'function' && target.get()) { |
|
fyi @bfollington not sure if you saw weirdness with compileAndRun. I was hitting errors trying to navigate to the second charm I generated due to issues with navigate & sharing cells... |
Summary by cubic
Added logic to ensure charms are added to the charm manager when navigating to them in Jumble, and fixed an issue where navigating to a charm could fail or reuse cells incorrectly.