Skip to content

Commit

Permalink
refactor: if expression
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandopasik committed Oct 2, 2024
1 parent 4dda627 commit 6c4cf7e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ export default (store: LazyStore & Store): void => {
});
}
if (this.active && !this.scrollDisable) {
if (typeof this.scrollOpt !== 'undefined') {
if (hasBecomeActive) {
this.scrollIntoView(this.scrollOpt);
}
} else {
if (typeof this.scrollOpt === 'undefined') {
window.scrollTo(0, 0);
} else if (hasBecomeActive) {
this.scrollIntoView(this.scrollOpt);
}
}
}
Expand Down

0 comments on commit 6c4cf7e

Please sign in to comment.