Просмотр исходного кода

change URL validation function name

keigo-h 3 лет назад
Родитель
Сommit
cfd451a54f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/client/services/ShowPageAccessories.tsx

+ 2 - 2
packages/app/src/client/services/ShowPageAccessories.tsx

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