Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add user prefix to entityRef in UserLink #153

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

Revyy
Copy link
Contributor

@Revyy Revyy commented Apr 24, 2024

Possible fix for issue: #152.

The if-statement in UserLink won't be executed at the moment if the entityRef is actually 'anonymous' as it will then always crash when executing useEntityPresentation.

A possible fix could be to move the check to the AuthorLink component as this PR suggests.
Not sure if it would need to be added in more places, like UpdatedByLink for example.

@drodil
Copy link
Owner

drodil commented Apr 24, 2024

Hm.. How about if you add check for the entityRef before using the hook that it starts with user: and add the prefix if it doesn't?

@Revyy Revyy changed the title fix: move anonymous check to AuthorLink to prevent error fix: add user prefix to entityRef in UserLink Apr 24, 2024
@drodil drodil merged commit 77f517f into drodil:main Apr 24, 2024
4 checks passed
@drodil
Copy link
Owner

drodil commented Apr 24, 2024

Great, thanks a lot, will release a fix version!

@Revyy Revyy deleted the fix-anonymous-user-breaking-userlink branch April 24, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants