소스 검색

Use `history.replaceState` on initial redirect

Eric Zhang 4 년 전
부모
커밋
f19d11f555
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/useHash.ts

+ 1 - 1
src/useHash.ts

@@ -9,7 +9,7 @@ function getHash() {
     for (let i = 0; i < idLen; i++) {
       id += chars[Math.floor(Math.random() * chars.length)];
     }
-    window.location.hash = id;
+    window.history.replaceState(null, "", "#" + id);
   }
   return window.location.hash.slice(1);
 }