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

Ensure service is fastboot compatible. Specifically with using `scrol… #98

Merged
merged 2 commits into from
Mar 6, 2018

Conversation

snewcomer
Copy link
Collaborator

…lElement`

@@ -26,6 +30,10 @@ export default Service.extend({
x = window.scrollX;
y = window.scrollY;
} else if ('#' === scrollElement.charAt(0)) {
if (get(this, 'isFastBoot')) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if this should go at the top of the update method....

@RobbieTheWagner
Copy link
Contributor

@snewcomer shouldn't we also be checking for fastboot in this file https://github.com/dollarshaveclub/ember-router-scroll/blob/master/addon/index.js? There are a few document and window usages in there. FWIW, I have never encountered a fastboot error using this addon, but I guess most of my usages were after the browser took over.

@snewcomer
Copy link
Collaborator Author

@rwwagner90 I think that is covered here, so prevents that code from ever running.

I wanted to use scrollElement (figured out I need #99), but still got an error on fastboot with scrollElement.

I think I should add some tests around that service as well for scrollElement

@RobbieTheWagner
Copy link
Contributor

Ah, I see. Tests would be great!

@RobbieTheWagner RobbieTheWagner merged commit 743e28a into DockYard:master Mar 6, 2018
@RobbieTheWagner
Copy link
Contributor

Thanks!

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