From 31591a38779dfef3f29e820810e42b3a4b32fcbd Mon Sep 17 00:00:00 2001 From: adventure-yunfei Date: Thu, 25 Aug 2022 16:41:34 +0800 Subject: [PATCH] Update packages/docusaurus/src/client/preload.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Lorber --- packages/docusaurus/src/client/preload.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus/src/client/preload.ts b/packages/docusaurus/src/client/preload.ts index 4434e929fd..a4faa7750d 100644 --- a/packages/docusaurus/src/client/preload.ts +++ b/packages/docusaurus/src/client/preload.ts @@ -17,7 +17,7 @@ import {matchRoutes} from 'react-router-config'; * @returns Promise object represents whether pathname has been preloaded */ export default function preload(pathname: string): Promise { - const matches = [pathname, decodeURI(pathname)] + const matches = Array.from(new Set([pathname, decodeURI(pathname)])) .map(p => matchRoutes(routes, p)) .flat();