UNPKG

@replyke/core

Version:

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

29 lines 1.09 kB
"use strict"; 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); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.markCommentAsFailed = markCommentAsFailed; 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