From 3b45435007165d3dcebc17f11c94071bdcfd8532 Mon Sep 17 00:00:00 2001 From: Georges Gomes Date: Mon, 4 Jul 2022 14:29:01 +0200 Subject: [PATCH] accept suggestion Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- src/client/app/router.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index e295f5ab..dc652d56 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -43,13 +43,9 @@ export function createRouter( // ensure correct deep link so page refresh lands on correct files. const url = new URL(href, fakeHost) // ensure correct deep link so page refresh lands on correct files. - if (siteDataRef.value.cleanUrls) { - // Should we replace `/foo.html` -> `/foo` ? :thinking: - } else { - if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) { - url.pathname += '.html' - href = url.pathname + url.search + url.hash - } + if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) { + url.pathname += siteDataRef.value.cleanUrls ? '/' : '.html' + href = url.pathname + url.search + url.hash } if (inBrowser) { // save scroll position before changing url