fix adding comment to store, again

This commit is contained in:
igoradamenko
2018-05-18 23:45:25 +03:00
parent ed0060ffcb
commit cbc74041c6
+4 -14
View File
@@ -30,21 +30,11 @@ class Store {
return this.data[key];
}
addComment({ text, id, pid }) {
const newComment = {
comment: {
id,
text,
user: this.get('user'),
time: new Date(),
...(pid ? { pid } : {}),
},
};
if (pid) {
this.pasteReply(newComment);
addComment(comment) {
if (comment.pid) {
this.pasteReply(comment);
} else {
this.pasteComment(newComment);
this.pasteComment(comment);
}
}