|
@@ -5,12 +5,6 @@ import { usePageAccessoriesModal, PageAccessoriesModalContents } from '~/stores/
|
|
|
function getURLQueryParamValue(key: string): string | null {
|
|
function getURLQueryParamValue(key: string): string | null {
|
|
|
// window.location.href is page URL;
|
|
// window.location.href is page URL;
|
|
|
const queryStr: URLSearchParams = new URL(window.location.href).searchParams;
|
|
const queryStr: URLSearchParams = new URL(window.location.href).searchParams;
|
|
|
- if (queryStr === null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- if (queryStr.get(key) === null) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
return queryStr.get(key);
|
|
return queryStr.get(key);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -18,11 +12,10 @@ const ShowPageAccessoriesModal = (): JSX.Element => {
|
|
|
const { open: openPageAccessories } = usePageAccessoriesModal();
|
|
const { open: openPageAccessories } = usePageAccessoriesModal();
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
const pageIdParams = getURLQueryParamValue('compare');
|
|
const pageIdParams = getURLQueryParamValue('compare');
|
|
|
- if (pageIdParams === null) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (pageIdParams.split('...').length > 1) {
|
|
|
|
|
- openPageAccessories(PageAccessoriesModalContents.PageHistory);
|
|
|
|
|
|
|
+ if (pageIdParams != null) {
|
|
|
|
|
+ if (pageIdParams.split('...').length > 1) {
|
|
|
|
|
+ openPageAccessories(PageAccessoriesModalContents.PageHistory);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
}, []);
|
|
}, []);
|