aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index ccfc660cc..b96f8150d 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -116,13 +116,13 @@ export class CollectionView extends Touchable<FieldViewProps & CollectionViewCus
whenActiveChanged = (isActive: boolean) => this.props.whenActiveChanged(this._isChildActive = isActive);
@action.bound
- addDocument = (doc: Doc): boolean => {
+ addDocument = (doc: Doc | Doc[]): boolean => {
if (doc instanceof Doc) {
if (this.props.filterAddDocument?.(doc) === false) {
return false;
}
}
- const docs = doc instanceof Doc ? [doc] : doc as any as Doc[];
+ const docs = doc instanceof Doc ? [doc] : doc;
const targetDataDoc = this.props.Document[DataSym];
const docList = DocListCast(targetDataDoc[this.props.fieldKey]);
const added = docs.filter(d => !docList.includes(d));