Skip to content

Commit

Permalink
Merge pull request #18 from frontend-park-mail-ru/fix_gotopage_bug
Browse files Browse the repository at this point in the history
Исправлена ошибка: ререндеринг при добавлении query параметров
  • Loading branch information
IvanNaum authored Apr 5, 2024
2 parents ac66ac3 + 5f66dd7 commit 6fd6993
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function handleRouting() {

export function goToPage(path) {
window.history.pushState({}, '', path);
handleRouting();

if (window.location.pathname !== path.split('?')[0]) {
handleRouting();
}
}

// Обработка изменения URL
Expand Down

0 comments on commit 6fd6993

Please sign in to comment.