Skip to content

Commit

Permalink
set scrollpos selector to 0 for new path index
Browse files Browse the repository at this point in the history
  • Loading branch information
debuggdapps committed Dec 13, 2020
1 parent 07f57cf commit 9dbe155
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/redux/selectors/selectors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ bool saveScrollPositionSelector(AppState state) =>
(state != null) ? state.options.saveScrollPosition : false;

double getScrollOffsetForThisPath(Map<String, ScrollInfo> scrollPos, int id) {
//set scroll position for path with does not exist previously in saved options.
if (id > scrollPos.length) {
scrollPos[id.toString()] = ScrollInfo(id, 0.0, 0.0);
}

return scrollPos[id.toString()].scrollOffset;
}

Expand Down

0 comments on commit 9dbe155

Please sign in to comment.