Ver código fonte

do not anything when path is null

kaori 4 anos atrás
pai
commit
aa66be1643

+ 1 - 5
packages/app/src/components/Navbar/SubNavButtons.tsx

@@ -91,14 +91,10 @@ const SubNavButtonsSubstance = (props: SubNavButtonsSubstanceProps): JSX.Element
   }, [isGuestUser, mutateBookmarkInfo, mutatePageInfo, pageId, pageInfo]);
 
   const deleteMenuItemClickHandler = useCallback(async(_pageId: string): Promise<void> => {
-    if (onClickDeleteMenuItem == null) {
+    if (onClickDeleteMenuItem == null || path == null) {
       return;
     }
 
-    if (path == null) {
-      throw Error('path must not be null.');
-    }
-
     const pageToDelete: IPageForPageDeleteModal = {
       pageId,
       revisionId,