push to history stack instead of replace in Library and Discover

This commit is contained in:
nklhrstv 2020-03-29 18:22:02 +03:00
parent 76aa4b3b0b
commit 9764ec459a
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ const navigateWithRequest = (request) => {
const type = encodeURIComponent(request.path.type_name);
const catalogId = encodeURIComponent(request.path.id);
const extra = new URLSearchParams(request.path.extra).toString();
window.location.replace(`#/discover/${transportUrl}/${type}/${catalogId}?${extra}`);
window.location = `#/discover/${transportUrl}/${type}/${catalogId}?${extra}`;
};
const nextExtra = (prevExtra, extraProp, extraValue) => {

View file

@ -18,7 +18,7 @@ const mapSelectableInputs = (route, library) => {
onSelect: (event) => {
const type = JSON.parse(event.value);
const queryParams = new URLSearchParams(library.selected !== null ? [['sort', library.selected.sort]] : []);
window.location.replace(`#/${route}${type !== null ? `/${encodeURIComponent(type)}` : ''}?${queryParams.toString()}`);
window.location = `#/${route}${type !== null ? `/${encodeURIComponent(type)}` : ''}?${queryParams.toString()}`;
}
};
const sortSelect = {
@ -31,7 +31,7 @@ const mapSelectableInputs = (route, library) => {
onSelect: (event) => {
const type = library.selected !== null ? library.selected.type_name : null;
const queryParams = new URLSearchParams([['sort', event.value]]);
window.location.replace(`#/${route}${type !== null ? `/${encodeURIComponent(type)}` : ''}?${queryParams.toString()}`);
window.location = `#/${route}${type !== null ? `/${encodeURIComponent(type)}` : ''}?${queryParams.toString()}`;
}
};
return [typeSelect, sortSelect];