]> Untitled Git - lemmy.git/commitdiff
Adding key to comment-node to not clear out form. Fixes #588
authorDessalines <tyhou13@gmx.com>
Tue, 10 Mar 2020 01:38:10 +0000 (21:38 -0400)
committerDessalines <tyhou13@gmx.com>
Tue, 10 Mar 2020 01:38:10 +0000 (21:38 -0400)
ui/src/components/comment-nodes.tsx
ui/src/components/post.tsx

index b15da5208954739d1e82c131c8f19b596024916d..ebbef8fad48b5d3dab4ea3732c90905d08a68c81 100644 (file)
@@ -38,6 +38,7 @@ export class CommentNodes extends Component<
       <div className="comments">
         {this.sorter().map(node => (
           <CommentNode
+            key={node.comment.id}
             node={node}
             noIndent={this.props.noIndent}
             viewOnly={this.props.viewOnly}
index ed1ba3021d7a0cc5c481ba89b8d252cbea0d08ce..0485975a19fb137e2fce9dde71b35922bd9bff72 100644 (file)
@@ -300,7 +300,7 @@ export class Post extends Component<any, PostState> {
     i.setState(i.state);
   }
 
-  private buildCommentsTree(): Array<CommentNodeI> {
+  buildCommentsTree(): Array<CommentNodeI> {
     let map = new Map<number, CommentNodeI>();
     for (let comment of this.state.comments) {
       let node: CommentNodeI = {