Sfoglia il codice sorgente

fix currentPagePath return blank when null 2

taikou-m 10 mesi fa
parent
commit
ad5da13ace

+ 1 - 1
apps/app/src/client/components/PageControls/PageControls.tsx

@@ -140,7 +140,7 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =
   const { data: isUsersHomepageDeletionEnabled } = useIsUsersHomepageDeletionEnabled();
   const { data: isUsersHomepageDeletionEnabled } = useIsUsersHomepageDeletionEnabled();
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: currentPagePath } = useCurrentPagePath();
 
 
-  const isUsersHomepage = pagePathUtils.isUsersHomepage(currentPagePath ?? 'false');
+  const isUsersHomepage = currentPagePath == null ? false : pagePathUtils.isUsersHomepage(currentPagePath);
 
 
   const { mutate: mutatePageInfo } = useSWRxPageInfo(pageId, shareLinkId);
   const { mutate: mutatePageInfo } = useSWRxPageInfo(pageId, shareLinkId);