Skip to content
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

Subscribed to another event in order to trigger theme change on story change #10

Conversation

carlesnunez
Copy link

@carlesnunez carlesnunez commented Jul 12, 2019

What does this PR do?
This PR fixes a bug related to the moment in which we navigate through stories with a theme different to the base configured theme.

In order to fix it we will subscribe to another event that will trigger the same exact logic that the one triggered on stories configured.

It fixes issue: #9

Copy link
Owner

@hipstersmoothie hipstersmoothie left a comment

Choose a reason for hiding this comment

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

@carlesnunez Thanks for the contribution! Just one small change

src/Tool.tsx Outdated
});
React.useEffect(() => {
const channel = props.api.getChannel();
channel.on('storyChanged', () => renderTheme());
Copy link
Owner

Choose a reason for hiding this comment

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

Could this just be the following?

Suggested change
channel.on('storyChanged', () => renderTheme());
channel.on('storyChanged', renderTheme);

Copy link
Author

Choose a reason for hiding this comment

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

I think that there not be any problem! I'll commit the change

Copy link
Author

Choose a reason for hiding this comment

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

Changes made @hipstersmoothie !

@carlesnunez
Copy link
Author

What's the status of this one?

@hipstersmoothie hipstersmoothie merged commit d39678b into hipstersmoothie:master Jul 17, 2019
@hipstersmoothie
Copy link
Owner

hipstersmoothie commented Jul 17, 2019

Released!

@carlesnunez
Copy link
Author

Good and fast job done @hipstersmoothie !!!

@carlesnunez carlesnunez deleted the fix/trigger-theme-change-on-story-change branch July 19, 2019 10:04
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