Skip to content

Conversation

@samrith-s
Copy link
Contributor

Update CollectionInfo in Header's render function.

What kind of change does this PR introduce?
This issue fixes a bug and maintains resonance of the sandbox name between the sidebar and the header.

What is the current behavior?
#1680

Checklist:

  • Documentation (NA)
  • Tests (NA)
  • Ready to be merged
  • Added myself to contributors table

The issue was CollectionInfo was being passed a reference to a sub-sect of observable store, from Header. But MobX states that for the observable to trigger a reaction, it needs to be called in render.

The quick fix is to pass a new reference of sandbox toCollectionInfo, rather than passing the observable.

Samrith Shankar added 2 commits April 2, 2019 02:27
* Pass a new reference of sandbox to CollectionInfo
@CompuIves
Copy link
Member

Great! Thanks a lot @samrith-s

Copy link
Member

@CompuIves CompuIves left a comment

Choose a reason for hiding this comment

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

Left a small comment, after that it's ready for merge!

<CollectionInfo isLoggedIn={store.isLoggedIn} sandbox={sandbox} />
<CollectionInfo
isLoggedIn={store.isLoggedIn}
sandbox={{ ...sandbox }}
Copy link
Member

Choose a reason for hiding this comment

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

Could you leave a comment as to why you do this? Also, maybe sandbox.toJS() works too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will check that out, and shall leave a comment too!

* Used MobX toJS function over spreading
@samrith-s
Copy link
Contributor Author

@CompuIves done! Do have a look.

@CompuIves
Copy link
Member

Great! Thank you a lot, really nice to have these contributions! Merging now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants