1 import { getCommentParentId, searchCommentTree } from "@utils/app";
2 import { CommentView } from "lemmy-js-client";
3 import { CommentNodeI } from "../../interfaces";
5 export default function insertCommentIntoTree(
10 // Building a fake node to be used for later
11 const node: CommentNodeI = {
17 const parentId = getCommentParentId(cv.comment);
19 const parent_comment = searchCommentTree(tree, parentId);
21 node.depth = parent_comment.depth + 1;
22 parent_comment.children.unshift(node);
24 } else if (!parentComment) {