fix(companion): event type links for org user - #5
Conversation
Addresses Cubic AI review feedback (confidence 9/10): The username was hardcoded to 'username' but still used by BasicsTab as a fallback for URL display when bookingUrl is unavailable. This restores the useEffect that fetches the actual username from CalComAPIService.getUsername(). Co-Authored-By: unknown <>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 161a777b0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handlePreview = async () => { | ||
| const eventTypeSlug = eventSlug || "preview"; | ||
| let link: string; | ||
| try { | ||
| link = await CalComAPIService.buildEventTypeLink(eventTypeSlug); | ||
| } catch (error) { | ||
| safeLogError("Failed to generate preview link:", error); | ||
| showErrorAlert("Error", "Failed to generate preview link. Please try again."); | ||
| if (!bookingUrl) { | ||
| showErrorAlert("Error", "Booking URL not available. Please save the event type first."); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Populate bookingUrl before guarding preview/copy
The new guard in handlePreview blocks whenever bookingUrl is falsy, but this component never sets bookingUrl after initializing it to "" (there are no setBookingUrl(...) calls when the event type is loaded). As a result, the preview action will always show the “Booking URL not available” error even for existing event types, and the same issue applies to copy link. Consider setting bookingUrl from the fetched event type (or falling back to the previous buildEventTypeLink behavior) so the link actions keep working when bookingUrl is absent.
Useful? React with 👍 / 👎.
Benchmark PR from agentic-review-benchmarks#5