Merge pull request #2713 from nextcloud/bugfix/noid/console-error

fix(viewer): Do not attempt to register file actions if not available
This commit is contained in:
Marcel Klehr 2023-01-03 15:24:16 +01:00 committed by GitHub
commit f4886e2598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ if (OCA.Viewer) {
// TODO: Viewer.openWith introduced with https://github.com/nextcloud/viewer/pull/1273
// This check can be replaced with `if(OCA.Viewer)` once NC 24 is EOL.
if (OCA.Viewer.openWith) {
if (OCA.Viewer.openWith && OCA?.Files?.fileActions) {
const supportedMimes = getCapabilities().richdocuments.mimetypesNoDefaultOpen
const actionName = 'Edit with ' + getCapabilities().richdocuments.productName
const actionDisplayNameEdit = t('richdocuments', 'Edit with {productName}', { productName: getCapabilities().richdocuments.productName }, undefined, { escape: false })