Skip to content

Commit

Permalink
Ещё оддна попытка исправления для GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyAkkuratov committed May 30, 2024
1 parent 8df7eae commit ab0e900
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/weatherApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function weatherApp(rootElement) {
}

function onclickHistoryLine(event) {
router.navigate(`/weather/${event.target.innerHTML}`);
router.navigate(`${PREFIX}/weather/${event.target.innerHTML}`);
}

function createHistoryParagraph(cityName) {
Expand Down Expand Up @@ -102,13 +102,13 @@ export default async function weatherApp(rootElement) {
const inputEl = formElement.querySelector("#userInput");
const cityName = inputEl.value;
inputEl.value = "";
router.navigate(`/weather/${cityName}`);
router.navigate(`${PREFIX}/weather/${cityName}`);
});

rootElement.addEventListener("click", (event) => {
if (event.target instanceof HTMLAnchorElement) {
event.preventDefault();
router.navigate(event.target.pathname);
router.navigate(PREFIX + event.target.pathname);
}
});

Expand All @@ -135,5 +135,5 @@ export default async function weatherApp(rootElement) {
});

loadHistory();
if (ipInfo.city) router.navigate(`/weather/${ipInfo.city}`);
if (ipInfo.city) router.navigate(`${PREFIX}/weather/${ipInfo.city}`);
}

0 comments on commit ab0e900

Please sign in to comment.