Skip to content

Commit

Permalink
fix(links): catch errors of loadState() in public shares
Browse files Browse the repository at this point in the history
`loadState('core', 'active-app')` throws an error in public shares,
which breaks loading pages with links.

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Mar 26, 2024
1 parent d52c2d7 commit baf477e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/helpers/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ const domHref = function(node, relativePath) {
return ref
}
// Don't rewrite links in collectives app context
if (loadState('core', 'active-app') === 'collectives') {
return ref
try {
if (loadState('core', 'active-app') === 'collectives') {
return ref
}
} catch {
// throws error in public shares
}
// Don't rewrite links to the collectives app
if (ref.includes('/apps/collectives/')) {
Expand Down

0 comments on commit baf477e

Please sign in to comment.