fix: allow guests to view event details by passing pre-loaded data
LearnMoreScreen now accepts an optional initialEvent parameter so it can render immediately from already-loaded data instead of re-fetching from the event-details API. This fixes the guest-mode flow where the unauthenticated API call was failing. Also changed getEventDetails to requiresAuth: true so logged-in users send their token when the API path is used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -503,7 +503,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
: (e.startDate != null && e.endDate != null ? '${e.startDate} - ${e.endDate}' : (e.startDate ?? ''));
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: e.id))),
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: e.id, initialEvent: e))),
|
||||
child: Card(
|
||||
elevation: 6,
|
||||
margin: const EdgeInsets.fromLTRB(20, 10, 20, 10),
|
||||
@@ -563,7 +563,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
|
||||
: (e.startDate ?? ''));
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: e.id))),
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: e.id, initialEvent: e))),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.fromLTRB(16, 0, 16, 14),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user