mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
Update packages/docusaurus/src/client/preload.ts
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
This commit is contained in:
parent
021158a02d
commit
31591a3877
|
|
@ -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<void[]> {
|
||||
const matches = [pathname, decodeURI(pathname)]
|
||||
const matches = Array.from(new Set([pathname, decodeURI(pathname)]))
|
||||
.map(p => matchRoutes(routes, p))
|
||||
.flat();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue