Shun Miyazawa 2 лет назад
Родитель
Сommit
d7cc2ca4c0
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      apps/app/src/components/Bookmarks/BookmarkFolderTree.tsx

+ 2 - 2
apps/app/src/components/Bookmarks/BookmarkFolderTree.tsx

@@ -36,14 +36,14 @@ export const BookmarkFolderTree: React.FC<Props> = (props: Props) => {
   const { t } = useTranslation();
 
   const { data: currentUser } = useCurrentUser();
-  const shouldMutateCurrentUserbookmarks = currentUser._id !== userId;
+  const shouldMutateCurrentUserbookmarks = currentUser?._id !== userId;
 
   const { data: isReadOnlyUser } = useIsReadOnlyUser();
   const { data: currentPage } = useSWRxCurrentPage();
   const { mutate: mutateBookmarkInfo } = useSWRBookmarkInfo(currentPage?._id);
   const { data: bookmarkFolders, mutate: mutateBookmarkFolders } = useSWRxBookmarkFolderAndChild(userId);
   const { data: userBookmarks, mutate: mutateUserBookmarks } = useSWRxUserBookmarks(userId);
-  const { mutate: mutateCurrentUserBookmarks } = useSWRxUserBookmarks(shouldMutateCurrentUserbookmarks ? currentUser._id : null);
+  const { mutate: mutateCurrentUserBookmarks } = useSWRxUserBookmarks(shouldMutateCurrentUserbookmarks ? currentUser?._id : null);
   const { open: openDeleteModal } = usePageDeleteModal();
 
   const bookmarkFolderTreeMutation = useCallback(() => {