diff --git a/frontend/src/components/PostEditForm.tsx b/frontend/src/components/PostEditForm.tsx index f584117..3ac2077 100644 --- a/frontend/src/components/PostEditForm.tsx +++ b/frontend/src/components/PostEditForm.tsx @@ -36,7 +36,8 @@ export default (({ post, onSave }: Props) => { useState (post.originalCreatedBefore) const [originalCreatedFrom, setOriginalCreatedFrom] = useState (post.originalCreatedFrom) - const [parentPostIds, setParentPostIds] = useState (post.parentPosts!.map (p => p.id).join (' ')) + const [parentPostIds, setParentPostIds] = + useState ((post.parentPosts ?? []).map (p => p.id).join (' ')) const [tags, setTags] = useState ('') const [title, setTitle] = useState (post.title) diff --git a/frontend/src/components/PostList.tsx b/frontend/src/components/PostList.tsx index 8bd6118..21a4410 100644 --- a/frontend/src/components/PostList.tsx +++ b/frontend/src/components/PostList.tsx @@ -42,8 +42,8 @@ export default (({ posts, onClick }: Props) => { layoutId={layoutId} className={cn ('w-full h-full overflow-hidden rounded-xl shadow', 'transform-gpu will-change-transform', - (post.childPosts ?? []).length > 0 && 'outline-4 border-green-500', - (post.parentPosts ?? []).length > 0 && 'outline-4 border-yellow-500')} + (post.childPosts ?? []).length > 0 && 'outline-4 outline-green-500', + (post.parentPosts ?? []).length > 0 && 'ring-4 ring-yellow-500')} whileHover={{ scale: 1.02 }} onLayoutAnimationStart={() => { if (!(cardRef.current)) diff --git a/frontend/src/pages/posts/PostHistoryPage.tsx b/frontend/src/pages/posts/PostHistoryPage.tsx index 825efe9..2977527 100644 --- a/frontend/src/pages/posts/PostHistoryPage.tsx +++ b/frontend/src/pages/posts/PostHistoryPage.tsx @@ -253,7 +253,7 @@ export default (() => { .filter (t => t.slice (0, 5) !== 'nico:') .join (' '), parent_post_ids: - change.parentPosts + (change.parentPosts ?? []) .filter (p => p.type !== 'removed') .map (p => p.id) .join (' '),