Skip to content

Commit

Permalink
change default action for files to details page
Browse files Browse the repository at this point in the history
  • Loading branch information
VargaJoe committed Mar 13, 2024
1 parent c91948e commit 431b618
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions apps/sensenet/src/services/content-context-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,8 @@ export function getPrimaryActionUrl({
return getUrlForContent({ content, uiSettings, location, action: 'image', snRoute, removePath })
}

if (
(content as any).Binary &&
(content as any).Binary.__mediaresource.content_type !== 'application/x-javascript' &&
(content as any).Binary.__mediaresource.content_type !== 'text/css' &&
(content as any).Binary.__mediaresource.content_type !== 'text/xml'
) {
return getUrlForContent({ content, uiSettings, location, action: 'preview', snRoute, removePath })
if ((content.Type === 'File' || repository.schemas.isContentFromType<ContentType>(content, 'File'))) {
return getUrlForContent({ content, uiSettings, location, action: 'browse', snRoute, removePath })
}

if (
Expand Down

0 comments on commit 431b618

Please sign in to comment.