UNPKG

@replyke/core

Version:

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

29 lines 923 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.markCommentAsDeletedInTree = markCommentAsDeletedInTree; /** * Reddit-style deletion: instead of removing the comment from the tree, * mark it as user-deleted by clearing content fields and setting userDeletedAt. * The comment remains visible as a placeholder so children stay intact. */ function markCommentAsDeletedInTree(state, commentId) { const entry = state[commentId]; if (!entry) return state; return { ...state, [commentId]: { ...entry, comment: { ...entry.comment, userDeletedAt: new Date(), content: null, gif: null, mentions: [], userId: null, user: undefined, }, }, }; } //# sourceMappingURL=markCommentAsDeletedInTree.js.map