From f79aab102c1f68a08d5d35389653c78f6772f171 Mon Sep 17 00:00:00 2001 From: HF Date: Sat, 24 Sep 2022 18:21:18 +0200 Subject: [PATCH] encode uri components in popup url split rankings into own script --- src/components/windows/UserArea.jsx | 9 ++++++--- src/components/windows/popUpAvailable.js | 2 +- src/store/reducers/popup.js | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/windows/UserArea.jsx b/src/components/windows/UserArea.jsx index e72ec4b..2a2bec8 100644 --- a/src/components/windows/UserArea.jsx +++ b/src/components/windows/UserArea.jsx @@ -14,8 +14,9 @@ import useInterval from '../hooks/interval'; import LogInArea from '../LogInArea'; import Tabs from '../Tabs'; import UserAreaContent from '../UserAreaContent'; -import Rankings from '../Rankings'; +// eslint-disable-next-line max-len +const Rankings = React.lazy(() => import(/* webpackChunkName: "stats" */ '../Rankings')); // eslint-disable-next-line max-len const Converter = React.lazy(() => import(/* webpackChunkName: "converter" */ '../Converter')); // eslint-disable-next-line max-len @@ -55,8 +56,10 @@ const UserArea = () => {
{(name) ? : }
-
- +
+ Loading...
}> + +
Loading...
}> diff --git a/src/components/windows/popUpAvailable.js b/src/components/windows/popUpAvailable.js index 4724ca5..f4b795e 100644 --- a/src/components/windows/popUpAvailable.js +++ b/src/components/windows/popUpAvailable.js @@ -31,7 +31,7 @@ export function buildPopUpUrl(windowType, argsIn) { for (let i = 0; i < typeArr.length; i += 1) { const key = typeArr[i]; if (args[key]) { - path += `/${args[key]}`; + path += `/${encodeURIComponent(args[key])}`; delete args[key]; } } diff --git a/src/store/reducers/popup.js b/src/store/reducers/popup.js index d7edd31..d16695d 100644 --- a/src/store/reducers/popup.js +++ b/src/store/reducers/popup.js @@ -20,7 +20,7 @@ function getWinDataFromURL() { let i = Math.min(typeArr.length, argsArr.length); while (i > 0) { i -= 1; - args[typeArr[i]] = argsArr[i]; + args[typeArr[i]] = decodeURIComponent(argsArr[i]); } } /*