Skip to content

Commit baf477e

Browse files
committed
fix(links): catch errors of loadState() in public shares
`loadState('core', 'active-app')` throws an error in public shares, which breaks loading pages with links. Signed-off-by: Jonas <[email protected]>
1 parent d52c2d7 commit baf477e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/helpers/links.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ const domHref = function(node, relativePath) {
3838
return ref
3939
}
4040
// Don't rewrite links in collectives app context
41-
if (loadState('core', 'active-app') === 'collectives') {
42-
return ref
41+
try {
42+
if (loadState('core', 'active-app') === 'collectives') {
43+
return ref
44+
}
45+
} catch {
46+
// throws error in public shares
4347
}
4448
// Don't rewrite links to the collectives app
4549
if (ref.includes('/apps/collectives/')) {

0 commit comments

Comments
 (0)