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

Prevent multiple calls on routeDidChange #241

Merged
merged 2 commits into from
Feb 25, 2020
Merged

Conversation

snewcomer
Copy link
Collaborator

If there is an existing callback to be called, we should prevent further executions of updating the scroll position

@snewcomer snewcomer added the bug label Feb 25, 2020
@snewcomer snewcomer self-assigned this Feb 25, 2020
addon/index.js Outdated
@@ -95,7 +98,7 @@ class EmberRouterScroll extends EmberRouter {
}

_routeDidChange(transition) {
if (get(this, 'isFastBoot')) {
if (get(this, 'isFastBoot') || REQUEST_CALLBACK) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually this should be debounce like instead of throttle like...

@snewcomer snewcomer merged commit 4db3449 into master Feb 25, 2020
@snewcomer snewcomer deleted the sn/prevent-multiple branch February 25, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant