Kaynağa Gözat

use urljoin

yohei0125 3 yıl önce
ebeveyn
işleme
eeb4da4b26
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  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));
   }
 };