Fixed linting errors and enabled instant loading

This commit is contained in:
squidfunk 2020-03-28 13:49:48 +01:00
parent f81ae11d59
commit f38d0a8d64
2 changed files with 12 additions and 4 deletions

View File

@ -47,7 +47,8 @@ import {
take,
shareReplay,
share,
pluck
pluck,
skip
} from "rxjs/operators"
import {
@ -352,8 +353,16 @@ export function initialize(config: unknown) {
if (config.features.includes("instant")) {
/* Disable automatic scroll restoration, as it doesn't work nicely */
if ("scrollRestoration" in history)
history.scrollRestoration = "manual"
location$
.pipe(
skip(1),
take(1)
)
.subscribe(() => {
console.log("disabled automatic scroll restoration")
if ("scrollRestoration" in history)
history.scrollRestoration = "manual"
})
/* Resolve relative links for stability */
for (const selector of [

View File

@ -135,7 +135,6 @@ export function setupInstantLoading(
)
.subscribe(location$)
const dom = new DOMParser()
const ajax$ = location$
.pipe(