Reset preventPushState after a replace

This commit is contained in:
2022-07-26 00:32:33 +02:00
parent eae632d0da
commit 742caad102

View File

@@ -23,11 +23,11 @@ const updateQueryParams = (id = null, type = null) => {
window.location.port ? `:${window.location.port}` : ""
}${window.location.pathname}${params.toString().length ? `?${params}` : ""}`;
if (!window.preventPushState) {
window.history.pushState({}, "search", url);
if (window.preventPushState) {
window.history.replaceState({}, "search", url);
window.preventPushState = false;
} else {
window.history.replaceState({}, "search", url);
window.history.pushState({}, "search", url);
}
};