diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 1a7e619ac..1e2f05170 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -647,7 +647,12 @@ export const renderCell = (cellValue: IAVCellValue, wrap: boolean) => {
text += ``;
} else if (cellValue.type === "rollup") {
cellValue?.rollup?.contents?.forEach((item, index) => {
- text += renderRollup(item, wrap) + (index === cellValue.rollup.contents.length - 1 ? "" : " ,");
+ const rollupText = renderRollup(item, wrap);
+ if (!rollupText && text) {
+ text = text.substring(0, text.length - 2);
+ } else {
+ text += rollupText + ((index === cellValue.rollup.contents.length - 1 || !rollupText) ? "" : ", ");
+ }
});
} else if (cellValue.type === "relation") {
cellValue?.relation?.contents?.forEach((item, index) => {
@@ -675,26 +680,27 @@ const renderRollup = (cellValue: IAVCellValue, wrap: boolean) => {
text = `${urlContent}`;
} else if (cellValue.type === "block") {
if (cellValue?.isDetached) {
- text = `${cellValue.block.content || ""}`;
+ text = `${cellValue.block?.content || ""}`;
} else {
- text = `${cellValue.block.content || ""}`;
+ text = `${cellValue.block?.content || ""}`;
}
} else if (cellValue.type === "number") {
- text = `${cellValue?.number.formattedContent || cellValue?.number.content || ""}`;
+ text = cellValue?.number.formattedContent || cellValue?.number.content.toString() || "";
} else if (cellValue.type === "mSelect" || cellValue.type === "select") {
cellValue?.mSelect?.forEach((item) => {
text += `${item.content}`;
});
} else if (cellValue.type === "date") {
const dataValue = cellValue ? cellValue.date : null;
- text = ``;
if (dataValue && dataValue.isNotEmpty) {
text += dayjs(dataValue.content).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
}
if (dataValue && dataValue.hasEndDate && dataValue.isNotEmpty && dataValue.isNotEmpty2) {
text += `${dayjs(dataValue.content2).format(dataValue.isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm")}`;
}
- text += "";
+ if (text) {
+ text = `${text}`;
+ }
} else if (["created", "updated"].includes(cellValue.type)) {
const dataValue = cellValue ? cellValue[cellValue.type as "date"] : null;
text = ``;