diff options
author | bobzel <zzzman@gmail.com> | 2024-04-25 18:03:15 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-04-25 18:03:15 -0400 |
commit | 08334824ad07dea1d0bb56d8ef91e3ad1a4573b0 (patch) | |
tree | 66bee872e9223eeb94aaff36a403435261b1cf40 /src/client/views/nodes/PDFBox.tsx | |
parent | fa50d38e671197ac333f99178fa3065a19ff834c (diff) |
added toList() for Doc|Doc[]
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
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; |