From d279e63cb4d417420cdc3fb3e6e03c96b777289f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=83=BD=E5=AE=81?= Date: Thu, 4 Jan 2024 05:00:14 +0800 Subject: [PATCH 1/2] fix: avoid pushing to history when clicking on the current link (#3405) Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- src/client/app/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 02d98944..a1397018 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -329,7 +329,7 @@ function shouldHotReload(payload: PageDataPayload): boolean { } function updateHistory(href: string) { - if (inBrowser && href !== normalizeHref(location.href)) { + if (inBrowser && normalizeHref(href) !== normalizeHref(location.href)) { // save scroll position before changing url history.replaceState({ scrollPosition: window.scrollY }, document.title) history.pushState(null, '', href) From be4c0c0c4b18b3e59d12729287d586e32b7b373b Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 4 Jan 2024 21:08:26 +0530 Subject: [PATCH 2/2] chore: update known extensions closes #3408 --- src/shared/shared.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/shared.ts b/src/shared/shared.ts index 8c8e4884..dce15728 100644 --- a/src/shared/shared.ts +++ b/src/shared/shared.ts @@ -186,7 +186,7 @@ const KNOWN_EXTENSIONS = new Set( 'p7c,p7m,p7r,p7s,pbm,pdf,pfx,php,png,ppt,pptx,ps,pub,qt,rar,roff,rtf,' + 'rtx,ser,sh,spc,svg,swf,t,tar,tcl,tex,texi,texinfo,tgz,tif,tiff,tr,ts,' + 'tsv,ttf,txt,ua,viv,vivo,vsd,wav,weba,webm,webp,woff,woff2,xbm,xhtml,' + - 'xls,xlsx,xml,xul,zip' + 'xls,xlsx,xml,xul,zip,conf' ).split(',') )