Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp authored and astrobot-houston committed Mar 3, 2024
1 parent 4bc360c commit 718eed7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/astro/src/transitions/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ if (inBrowser) {
if ('onscrollend' in window) addEventListener('scrollend', onScrollEnd);
else {
// Keep track of state between intervals
let intervalId: number | undefined, lastY: number, lastX: number, lastIndex: State["index"];
let intervalId: number | undefined, lastY: number, lastX: number, lastIndex: State['index'];
const scrollInterval = () => {
// Check the index to see if a popstate event was fired
if (lastIndex !== history.state?.index) {
Expand All @@ -642,20 +642,20 @@ if (inBrowser) {
return;
} else {
// Update vars with current positions
lastY = scrollY, lastX = scrollX;
(lastY = scrollY), (lastX = scrollX);
}
}
};
// We can't know when or how often scroll events fire, so we'll just use them to start intervals
addEventListener(
"scroll",
'scroll',
() => {
if (intervalId !== undefined) return;
lastIndex = history.state.index, lastY = scrollY, lastX = scrollX;
(lastIndex = history.state.index), (lastY = scrollY), (lastX = scrollX);
intervalId = window.setInterval(scrollInterval, 50);
},
{ passive: true }
);
};
}
}
for (const script of document.scripts) {
script.dataset.astroExec = '';
Expand Down

0 comments on commit 718eed7

Please sign in to comment.