File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
packages/volto/src/components/manage/UniversalLink Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -90,18 +90,25 @@ export function getUrl(
9090 url = remoteUrl ;
9191 }
9292
93+ const mimeType = item . mime_type ?. split ( ';' ) [ 0 ] ;
94+ const knownMime =
95+ mimeType &&
96+ ( config . settings . downloadableObjects . includes ( mimeType ) ||
97+ config . settings . viewableInBrowserObjects . includes ( mimeType ) ) ;
98+ const typeToCheck = knownMime ? mimeType : item [ '@type' ] ;
99+
93100 if (
94101 ! token &&
95- item [ '@type' ] &&
96- config . settings . downloadableObjects . includes ( item [ '@type' ] )
102+ typeToCheck &&
103+ config . settings . downloadableObjects . includes ( typeToCheck )
97104 ) {
98105 url = `${ url } /@@download/file` ;
99106 }
100107
101108 if (
102109 ! token &&
103- item [ '@type' ] &&
104- config . settings . viewableInBrowserObjects . includes ( item [ '@type' ] )
110+ typeToCheck &&
111+ config . settings . viewableInBrowserObjects . includes ( typeToCheck )
105112 ) {
106113 url = `${ url } /@@display-file/file` ;
107114 }
You can’t perform that action at this time.
0 commit comments