Skip to content

Commit

Permalink
fix(link): Don't rewrite links with fileId inside Collectives
Browse files Browse the repository at this point in the history
Required to allow relative links (and those without origin) to other
collectives pages to be resolved by link previews.

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Feb 28, 2024
1 parent 0b45c92 commit 69fa349
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/helpers/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*
*/

import { loadState } from '@nextcloud/initial-state'
import { generateUrl } from '@nextcloud/router'

const domHref = function(node, relativePath) {
Expand All @@ -36,6 +37,10 @@ const domHref = function(node, relativePath) {
if (ref.startsWith('#')) {
return ref
}
// Don't rewrite links in collectives app context
if (loadState('core', 'active-app') === 'collectives') {
return ref
}
// Don't rewrite links to the collectives app
if (ref.includes('/apps/collectives/')) {
return ref
Expand Down

0 comments on commit 69fa349

Please sign in to comment.