Skip to content

Commit

Permalink
[service:router-scroll] Use get instead of getWithDefaults.
Browse files Browse the repository at this point in the history
`getWithDefaults` returns the value (including `null`) for any key that
is defined. This caused a failure in [email protected] because you cannot do a
get lookup if the lookup value is `null`.
  • Loading branch information
Arjan Singh committed Aug 15, 2016
1 parent 2ab5a56 commit 0fbe54b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/services/router-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default Service.extend({
const stateId = get(window, 'history.state.id');

set(this, 'key', stateId);
const key = getWithDefault(this, 'key', '-1');
const key = get(this, 'key') || '-1';

return getWithDefault(scrollMap, key, { x: 0, y: 0 });
}).volatile(),
Expand Down

0 comments on commit 0fbe54b

Please sign in to comment.