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:
@@ -576,7 +576,7 @@ class _ProfileScreenState extends State<ProfileScreen>
|
||||
onTap: () {
|
||||
if (ev.id != null) {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: ev.id)));
|
||||
.push(MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: ev.id, initialEvent: ev)));
|
||||
}
|
||||
},
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
@@ -1388,7 +1388,7 @@ class _ProfileScreenState extends State<ProfileScreen>
|
||||
onTap: () {
|
||||
if (ev.id != null) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: ev.id)),
|
||||
MaterialPageRoute(builder: (_) => LearnMoreScreen(eventId: ev.id, initialEvent: ev)),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user