Bug: InviteCode is Undefined
Closed this issue · 2 comments
BharathxD commented
Issue: InviteCode is Undefined
Description
The InviteCode
property is undefined in the invite-code-modal.tsx
component. This component uses the useWorkspace()
hook, which returns the inviteCode
value. However, the inviteCode
appears to be undefined.
Investigation
After investigating the codebase, it seems that the /api/workspace
route is responsible for returning the inviteCode
. This route's response is likely the source of the undefined inviteCode
value.
Steps to Reproduce
- Navigate to https://app.dub.co//settings/people
- Click on the "Link" button.
- Open the browser console.
- Observe the
InviteCode
property being logged asundefined
.
Expected Behavior
The InviteCode
property should be a valid string value returned from the /api/workspace
route.
Possible Solutions
- Ensure that the
/api/workspace
route is returning the correctinviteCode
value. - Check if the
useWorkspace()
hook is correctly handling and returning theinviteCode
value. - Implement error handling and fallback mechanisms in the
invite-code-modal.tsx
component for cases where theinviteCode
is undefined.
Additional Context
invite-code-modal.tsx:22
linear commented
steven-tey commented
Thank you so much for the detailed bug report @BharathxD! We've just merged a PR that fixes this (will be deployed in a few minutes)