diff --git a/plugins/view-resources/src/actionImpl.ts b/plugins/view-resources/src/actionImpl.ts index 821d88564e..6dbbe0cbf0 100644 --- a/plugins/view-resources/src/actionImpl.ts +++ b/plugins/view-resources/src/actionImpl.ts @@ -135,12 +135,13 @@ function ShowActions (doc: Doc | Doc[] | undefined, evt: Event): void { showPopup(view.component.ActionsPopup, { viewContext: $contextStore[$contextStore.length - 1] }, 'top') } -function ShowPreview (doc: Doc | undefined, evt: Event): void { +function ShowPreview (doc: Doc | Doc[] | undefined, evt: Event): void { previewDocument.update((old) => { - if (old?._id === doc?._id) { + const d = Array.isArray(doc) ? doc[0] : doc + if (old?._id === d?._id) { return undefined } - return doc + return d }) evt.preventDefault() } diff --git a/plugins/view-resources/src/components/ActionHandler.svelte b/plugins/view-resources/src/components/ActionHandler.svelte index f921bdd3d8..71e2412404 100644 --- a/plugins/view-resources/src/components/ActionHandler.svelte +++ b/plugins/view-resources/src/components/ActionHandler.svelte @@ -13,7 +13,7 @@ // limitations under the License. -->