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

View File

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