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

feat(story): set default view for globe #198

Merged
merged 6 commits into from
Nov 15, 2019
Merged

feat(story): set default view for globe #198

merged 6 commits into from
Nov 15, 2019

Conversation

KatvonRivia
Copy link
Member

@KatvonRivia KatvonRivia commented Nov 14, 2019

closes #190

useEffect(() => {
if (slide && slide.flyTo) {
dispatch(setFlyToAction(slide.flyTo));
}
}, [dispatch, slide]);
if (slide && !slide.flyTo) {
dispatch(setFlyToAction(defaultView));

Choose a reason for hiding this comment

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

You don't need a second if condition here if you just write:

dispatch(setFlyToAction(slide.flyTo || defaultView));

if (slide && !slide.flyTo) {
dispatch(setFlyToAction(defaultView));
}
}, [dispatch, slide, defaultView]);

Choose a reason for hiding this comment

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

I guess the defaultView was added automatically here!? It doesn't make much sense here since it will never change, but never mind.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's from our hooks checker plugin. It throws an error/warning if it's not added there.

Choose a reason for hiding this comment

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

I thought so. The hooks plugin is... improvable... 😐🤷‍♀

@KatvonRivia KatvonRivia changed the base branch from feat/url-state to develop November 15, 2019 15:43
@KatvonRivia KatvonRivia merged commit 5125dc2 into develop Nov 15, 2019
@KatvonRivia KatvonRivia deleted the feat/story branch November 15, 2019 15:49
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.

Reset globe view when opening a story
2 participants