UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

18 lines 688 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.markCommentAsFailed = markCommentAsFailed; function markCommentAsFailed(state, commentId) { const comment = state[commentId]; const newState = { ...state }; newState[commentId] = { ...newState[commentId], failed: true }; // // Remove the comment from its parent’s replies // if (comment.comment?.parentId) { // const parent = newState[comment.comment.parentId]; // newState[comment.comment.parentId] = { // ...parent, // replies: parent.replies, // }; // } return newState; } //# sourceMappingURL=markCommentAsFailed.js.map