From 9764ec459a4d97433c5007d68ee0ab3ba2a79ed4 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Sun, 29 Mar 2020 18:22:02 +0300 Subject: [PATCH] push to history stack instead of replace in Library and Discover --- src/routes/Discover/useSelectableInputs.js | 2 +- src/routes/Library/useSelectableInputs.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/Discover/useSelectableInputs.js b/src/routes/Discover/useSelectableInputs.js index 790444406..bc968bdf8 100644 --- a/src/routes/Discover/useSelectableInputs.js +++ b/src/routes/Discover/useSelectableInputs.js @@ -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) => { diff --git a/src/routes/Library/useSelectableInputs.js b/src/routes/Library/useSelectableInputs.js index 51685d169..0802a3a30 100644 --- a/src/routes/Library/useSelectableInputs.js +++ b/src/routes/Library/useSelectableInputs.js @@ -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];