Skip to content

Commit

Permalink
chore: 불필요 코드 새로고침 부분 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
류제천 authored and 류제천 committed Nov 16, 2022
1 parent d292c6f commit 217b1b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const routes = {
};

const handleLocation = async () => {
let path = window.location.hash.replace("#", "");
let path = window.location.hash.replace("#", ""); //#about -> about

// "http://example.com/"가 아니라 도메인 뒤에 / 없이 "http://example.com" 으로 나오는 경우
if (path.length == 0) {
Expand All @@ -31,6 +31,4 @@ const GoToLorem = () => {
window.addEventListener("hashchange", handleLocation);

// 첫 랜딩 또는 새로고침 시 처리
document.addEventListener("DOMContentLoaded", function () {
handleLocation();
});
document.addEventListener("DOMContentLoaded", handleLocation);

0 comments on commit 217b1b7

Please sign in to comment.