jam411 3 tahun lalu
induk
melakukan
b14c1f9bb6

+ 2 - 3
packages/app/src/interfaces/bookmark-info.ts

@@ -1,9 +1,8 @@
 import { Ref } from '@growi/core';
 
+import { IPageHasId } from '~/interfaces/page';
 import { IUser } from '~/interfaces/user';
 
-import { IPage } from './page';
-
 export type IBookmarkInfo = {
   sumOfBookmarks: number;
   isBookmarked: boolean,
@@ -12,7 +11,7 @@ export type IBookmarkInfo = {
 
 export type BookmarkListPage = {
   _id: string,
-  page: Populated<IPage>,
+  page: IPageHasId,
   user: Ref<IUser>,
   createdAt: Date,
 }

+ 2 - 6
packages/app/src/pages/[[...path]].page.tsx

@@ -345,9 +345,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
                   Bookmarks
                 </h2>
                 <div id="user-bookmark-list" className="page-list">
-                  <div className="page-list-container">
-                    <BookmarkList userId={pageWithMeta?.data.creator._id} />
-                  </div>
+                  { (pageWithMeta != null) && (<BookmarkList userId={pageWithMeta?.data.creator._id} />) }
                 </div>
               </div>
               <div className="grw-user-page-list-m mt-5 d-edit-none">
@@ -358,9 +356,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
                   Recently Created
                 </h2>
                 <div id="user-created-list" className="page-list">
-                  <div className="page-list-container">
-                    <RecentCreated userId={pageWithMeta?.data.creator._id} />
-                  </div>
+                  { (pageWithMeta != null) && (<RecentCreated userId={pageWithMeta?.data.creator._id} />) }
                 </div>
               </div>
             </div>