From 08334824ad07dea1d0bb56d8ef91e3ad1a4573b0 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 25 Apr 2024 18:03:15 -0400 Subject: added toList() for Doc|Doc[] --- src/client/views/collections/collectionSchema/SchemaTableCell.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client/views/collections/collectionSchema') diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index ee30006ae..b89ca3614 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -16,7 +16,7 @@ import { DateField } from '../../../../fields/DateField'; import { Doc, DocListCast, Field } from '../../../../fields/Doc'; import { RichTextField } from '../../../../fields/RichTextField'; import { ColumnType } from '../../../../fields/SchemaHeaderField'; -import { BoolCast, Cast, DateCast, DocCast, FieldValue, StrCast } from '../../../../fields/Types'; +import { BoolCast, Cast, DateCast, DocCast, FieldValue, StrCast, toList } from '../../../../fields/Types'; import { ImageField } from '../../../../fields/URLField'; import { FInfo, FInfoFieldType } from '../../../documents/Documents'; import { DocFocusOrOpen } from '../../../util/DocumentManager'; @@ -67,8 +67,8 @@ export class SchemaTableCell extends ObservableReactComponent { - DocFocusOrOpen(doc instanceof Doc ? doc : doc[0]); + static addFieldDoc = (docs: Doc | Doc[] /* , where: OpenWhere */) => { + DocFocusOrOpen(toList(docs)[0]); return true; }; public static renderProps(props: SchemaTableCellProps) { -- cgit v1.2.3-70-g09d2