@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
26 lines • 974 B
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
export function markCommentAsFailed(state, commentId) {
var comment = state[commentId];
var newState = __assign({}, state);
newState[commentId] = __assign(__assign({}, 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