elseware-ui 2.31.13 → 2.31.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -18034,6 +18034,10 @@ function CommentThread({
|
|
|
18034
18034
|
);
|
|
18035
18035
|
}
|
|
18036
18036
|
}
|
|
18037
|
+
function updateCommentEverywhere(commentId, updater) {
|
|
18038
|
+
setComments((prev) => updateComment(prev, commentId, updater));
|
|
18039
|
+
setReplyCache((prev) => updateReplyCacheComment(prev, commentId, updater));
|
|
18040
|
+
}
|
|
18037
18041
|
async function handleReply(parentComment, content) {
|
|
18038
18042
|
const reply = await dataSource.createComment({
|
|
18039
18043
|
content,
|
|
@@ -18119,6 +18123,10 @@ function CommentThread({
|
|
|
18119
18123
|
);
|
|
18120
18124
|
}
|
|
18121
18125
|
}
|
|
18126
|
+
function handleEditComment(updatedComment) {
|
|
18127
|
+
updateCommentEverywhere(updatedComment.id, () => updatedComment);
|
|
18128
|
+
onEdit?.(updatedComment);
|
|
18129
|
+
}
|
|
18122
18130
|
if (loading || isLoadingComments) {
|
|
18123
18131
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6", children: "Loading comments..." });
|
|
18124
18132
|
}
|
|
@@ -18143,7 +18151,7 @@ function CommentThread({
|
|
|
18143
18151
|
onDislike: handleDislike,
|
|
18144
18152
|
onReply: handleReply,
|
|
18145
18153
|
onLoadReplies: handleLoadReplies,
|
|
18146
|
-
onEdit,
|
|
18154
|
+
onEdit: handleEditComment,
|
|
18147
18155
|
onDelete: handleDeleteComment,
|
|
18148
18156
|
onReport
|
|
18149
18157
|
}
|