-
Notifications
You must be signed in to change notification settings - Fork 0
fix(companion): event type links for org user #68
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
base: cursor_combined_20260121_qodo_grep_cursor_copilot_1_base_fixcompanion_event_type_links_for_org_user_pr706
Are you sure you want to change the base?
Changes from all commits
a92077c
cdfe735
102ed08
2b19bab
a3416cd
a0a15e1
4f49041
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { Button, ContextMenu, Host, HStack, Image as SwiftUIImage } from "@expo/ui/swift-ui"; | ||
| import { Button, Host, Image as SwiftUIImage } from "@expo/ui/swift-ui"; | ||
| import * as Haptics from "expo-haptics"; | ||
| import { buttonStyle, controlSize, fixedSize, frame, padding } from "@expo/ui/swift-ui/modifiers"; | ||
| import { buttonStyle, controlSize, frame, padding } from "@expo/ui/swift-ui/modifiers"; | ||
| import { Ionicons } from "@expo/vector-icons"; | ||
| import * as Clipboard from "expo-clipboard"; | ||
| import { isLiquidGlassAvailable } from "expo-glass-effect"; | ||
|
|
@@ -28,7 +28,7 @@ import { | |
| useUserProfile, | ||
| } from "@/hooks"; | ||
| import { useEventTypeFilter } from "@/hooks/useEventTypeFilter"; | ||
| import { CalComAPIService, type EventType } from "@/services/calcom"; | ||
| import type { EventType } from "@/services/calcom"; | ||
| import { showErrorAlert, showSuccessAlert } from "@/utils/alerts"; | ||
| import { openInAppBrowser } from "@/utils/browser"; | ||
| import { getAvatarUrl } from "@/utils/getAvatarUrl"; | ||
|
|
@@ -111,21 +111,27 @@ export default function EventTypesIOS() { | |
| }; | ||
|
|
||
| const handleCopyLink = async (eventType: EventType) => { | ||
| if (!eventType.bookingUrl) { | ||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||
| return; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mobile app handlers lack fallback URL unlike extensionMedium Severity The mobile app's Additional Locations (1) |
||
| try { | ||
| const link = await CalComAPIService.buildEventTypeLink(eventType.slug); | ||
| await Clipboard.setStringAsync(link); | ||
| await Clipboard.setStringAsync(eventType.bookingUrl); | ||
| showSuccessAlert("Link Copied", "Event type link copied!"); | ||
| } catch { | ||
| showErrorAlert("Error", "Failed to copy link. Please try again."); | ||
| } | ||
| }; | ||
|
|
||
| const _handleShare = async (eventType: EventType) => { | ||
| if (!eventType.bookingUrl) { | ||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||
| return; | ||
| } | ||
| try { | ||
| const link = await CalComAPIService.buildEventTypeLink(eventType.slug); | ||
| await Share.share({ | ||
| message: `Book a meeting: ${eventType.title}`, | ||
| url: link, | ||
| url: eventType.bookingUrl, | ||
| }); | ||
| } catch { | ||
| showErrorAlert("Error", "Failed to share link. Please try again."); | ||
|
|
@@ -226,10 +232,12 @@ export default function EventTypesIOS() { | |
| }; | ||
|
|
||
| const handlePreview = async (eventType: EventType) => { | ||
| if (!eventType.bookingUrl) { | ||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||
| return; | ||
| } | ||
| try { | ||
| const link = await CalComAPIService.buildEventTypeLink(eventType.slug); | ||
| // For mobile, use in-app browser | ||
| await openInAppBrowser(link, "event type preview"); | ||
| await openInAppBrowser(eventType.bookingUrl, "event type preview"); | ||
| } catch { | ||
| console.error("Failed to open preview"); | ||
| showErrorAlert("Error", "Failed to open preview. Please try again."); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bookingUrlstate is never populated from API dataHigh Severity
The
bookingUrlstate is initialized to an empty string butsetBookingUrlis never called. TheapplyEventTypeDatafunction loads many fields from the API response but never setsbookingUrlfromeventType.bookingUrl. This causeshandlePreviewandhandleCopyLinkto always fail with "Booking URL not available" since the empty string is falsy.Additional Locations (1)
companion/app/(tabs)/(event-types)/event-type-detail.tsx#L948-L953