|
|
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
|
|
|
|
|
|
import { usePageAccessoriesModal, PageAccessoriesModalContents } from '~/stores/modal';
|
|
|
|
|
|
-function hasURLQueryParamValue(key: string): string | null {
|
|
|
+function getURLQueryParamValue(key: string): string | null {
|
|
|
// window.location.href is page URL;
|
|
|
const queryStr: URLSearchParams = new URL(window.location.href).searchParams;
|
|
|
if (queryStr === null) {
|
|
|
@@ -17,7 +17,7 @@ function hasURLQueryParamValue(key: string): string | null {
|
|
|
const ShowPageAccessoriesModal = (): JSX.Element => {
|
|
|
const { open: openPageAccessories } = usePageAccessoriesModal();
|
|
|
useEffect(() => {
|
|
|
- if (hasURLQueryParamValue('compare')!.split('...').length > 1) {
|
|
|
+ if (getURLQueryParamValue('compare')!.split('...').length > 1) {
|
|
|
openPageAccessories(PageAccessoriesModalContents.PageHistory);
|
|
|
}
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|