From 08334824ad07dea1d0bb56d8ef91e3ad1a4573b0 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 25 Apr 2024 18:03:15 -0400
Subject: added toList() for Doc|Doc[]

---
 src/client/views/nodes/PDFBox.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/PDFBox.tsx')

diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index fdba9ff49..780ac3acb 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -12,7 +12,7 @@ import { DocData } from '../../../fields/DocSymbols';
 import { Id } from '../../../fields/FieldSymbols';
 import { InkTool } from '../../../fields/InkField';
 import { ComputedField } from '../../../fields/ScriptField';
-import { Cast, FieldValue, ImageCast, NumCast, StrCast } from '../../../fields/Types';
+import { Cast, FieldValue, ImageCast, NumCast, StrCast, toList } from '../../../fields/Types';
 import { ImageField, PdfField } from '../../../fields/URLField';
 import { TraceMobx } from '../../../fields/util';
 import { emptyFunction } from '../../../Utils';
@@ -231,7 +231,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() implem
     }
 
     sidebarAddDocTab = (docIn: Doc | Doc[], where: OpenWhere) => {
-        const docs = docIn instanceof Doc ? [docIn] : docIn;
+        const docs = toList(docIn);
         if (docs.some(doc => DocListCast(this.Document[this._props.fieldKey + '_sidebar']).includes(doc)) && !this.SidebarShown) {
             this.toggleSidebar(false);
             return true;
-- 
cgit v1.2.3-70-g09d2

