Skip to content

Commit 36d2866

Browse files
committed
fix: handle case if no columnConfig is found
1 parent f37f094 commit 36d2866

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

desk/src/components/ListViewBuilder.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,8 @@ const quickFilters = createResource({
301301
302302
function listCell(column: any, row: any, item: any, idx: number) {
303303
const columnConfig = props.options.columnConfig;
304-
if (!columnConfig) return;
305-
const customColumn = columnConfig[column.key] || {};
306-
if (customColumn.hasOwnProperty("custom")) {
307-
return customColumn.custom({ column, row, item, idx });
304+
if (columnConfig && columnConfig[column.key]?.custom) {
305+
return columnConfig[column.key]?.custom({ column, row, item, idx });
308306
}
309307
if (idx === 0) {
310308
return h("span", {
@@ -314,7 +312,7 @@ function listCell(column: any, row: any, item: any, idx: number) {
314312
}
315313
if (column.type === "Datetime") {
316314
return h("span", {
317-
class: "truncate text-base",
315+
class: "text-base",
318316
innerHTML: dayjs.tz(item).fromNow(),
319317
});
320318
}

0 commit comments

Comments
 (0)