Fixed race condition when scroll to 0 intends to happend after page-switch

This commit is contained in:
Niko 2022-02-27 12:50:07 +01:00
parent b0fefb4690
commit ccf5954091
1 changed files with 2 additions and 1 deletions

View File

@ -625,7 +625,8 @@ window.onscroll = function(e) {
return;
if (scroll() === 0)
setTimeout(async function() {
if (scroll() === 0) {
if (scroll() === 0 && page() !== null &&
page().onScroll !== undefined) {
await page().onScroll(0, true);
window.scrollTo(0,0);
}