From 33b6bb0290587228db16de883d99b3dfe4f3daae Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Mon, 16 Sep 2019 13:12:36 +0300 Subject: [PATCH] replace location when filters in library changed --- src/routes/Library/useLibrary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/Library/useLibrary.js b/src/routes/Library/useLibrary.js index 91675c288..452f63bd9 100644 --- a/src/routes/Library/useLibrary.js +++ b/src/routes/Library/useLibrary.js @@ -62,11 +62,11 @@ const useLibrary = (type, sort) => { if (name === 'type') { const nextQuery = new URLSearchParams({ sort: typeof sort === 'string' ? sort : '' }); const nextType = typeof value === 'string' ? value : ''; - window.location = `#/library/${nextType}?${nextQuery}`; + window.location.replace(`#/library/${nextType}?${nextQuery}`); } else if (name === 'sort') { const nextQuery = new URLSearchParams({ sort: typeof value === 'string' ? value : '' }); const nextType = typeof type === 'string' ? type : ''; - window.location = `#/library/${nextType}?${nextQuery}`; + window.location.replace(`#/library/${nextType}?${nextQuery}`); } }, [type, sort]); const typeDropdown = React.useMemo(() => {