소스 검색

use urljoin

yohei0125 3 년 전
부모
커밋
eeb4da4b26
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/app/src/components/NotFoundPage.tsx

+ 2 - 1
packages/app/src/components/NotFoundPage.tsx

@@ -1,6 +1,7 @@
 import React, { useMemo, useEffect } from 'react';
 
 import { useTranslation } from 'react-i18next';
+import urljoin from 'url-join';
 
 import { useCurrentPageId, useCurrentPagePath } from '~/stores/context';
 
@@ -16,7 +17,7 @@ import PageTimeline from './PageTimeline';
 const replaceURLHistory = (pageId: string, path: string) => {
   if (pageId != null) {
     const queryParameters = window.location.search;
-    window.history.replaceState(null, '', `${path}${queryParameters}`);
+    window.history.replaceState(null, '', urljoin(path, queryParameters));
   }
 };