Refine BIM comment modal controls
This commit is contained in:
+10
-4
@@ -1606,14 +1606,20 @@ const sanitizeCommentSubitems = (value) => {
|
||||
if (!item || typeof item !== "object") {
|
||||
return [];
|
||||
}
|
||||
const title = sanitizeCommentText(item.title ?? item.text ?? item.name, 300);
|
||||
if (!title) {
|
||||
const kind = item.kind === "text" ? "text" : "checker";
|
||||
const rawContent = kind === "text"
|
||||
? (item.body ?? item.title ?? item.text ?? item.name)
|
||||
: (item.title ?? item.text ?? item.name ?? item.body);
|
||||
const content = sanitizeCommentText(rawContent, kind === "text" ? 4000 : 300);
|
||||
if (!content) {
|
||||
return [];
|
||||
}
|
||||
return [{
|
||||
id: stringOrNull(item.id) || `sub_${randomBase64Url(8)}`,
|
||||
title,
|
||||
done: item.done === true,
|
||||
kind,
|
||||
title: content,
|
||||
body: kind === "text" ? content : "",
|
||||
done: kind === "checker" && item.done === true,
|
||||
createdAt: stringOrNull(item.createdAt) || nowIso()
|
||||
}];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user