Explorar o código

Merge branch 'feat/77525-80785-implement-select-all' into feat/77525-81100-check-if-selected-pages-has-page

# Conflicts:
#	packages/app/src/components/SearchPage/SearchResultList.tsx
SULLEY\ryo-h %!s(int64=4) %!d(string=hai) anos
pai
achega
4f919c9513

+ 2 - 2
packages/app/src/components/SearchPage/SearchResultList.tsx

@@ -1,4 +1,4 @@
-import React, { FC } from 'react';
+import React, { FC } from 'react';
 import SearchResultListItem from './SearchResultListItem';
 import { IPageHasId } from '../../interfaces/page';
 import PaginationWrapper from '../PaginationWrapper';
@@ -30,7 +30,7 @@ const SearchResultList: FC<Props> = (props:Props) => {
 
   return (
     <>
-      {props.pages.map((page) => {
+      {Array.isArray(props.pages) && props.pages.map((page) => {
         const isChecked = selectedPages.has(page);
         return (
           <SearchResultListItem

+ 4 - 4
packages/app/src/components/SearchPage/SearchResultListItem.tsx

@@ -87,13 +87,13 @@ const SearchResultListItem: FC<Props> = (props:Props) => {
   const pagePathElem = <PagePathLabel page={page} isFormerOnly />;
 
   const onClickSearchedResultItem = () => {
-    if (onClickInvoked == null) { throw new Error('onClickInvoked is null') }
-    onClickInvoked(page._id);
+    if (onClickInvoked == null) { logger.error('onClickInvoked is null') }
+    else onClickInvoked(page._id);
   };
 
   const onClickCheckbox = () => {
-    if (onClickCheckboxInvoked == null) { throw new Error('onClickCheckboxInvoked is null') }
-    onClickCheckboxInvoked(page);
+    if (onClickCheckboxInvoked == null) { logger.error('onClickCheckboxInvoked is null') }
+    else onClickCheckboxInvoked(page);
   };
 
   return (