Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/components/EntityDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,22 @@ export default function EntityDetail({ entitySlug, initialEntity }: { entitySlug
setEmbedsLoading(true);

try {
// Clear the old cache first
// Clear the old cache first (both standard and minimal embeds)
clearEmbedCache('entities', entity.slug, 'embeds');
clearEmbedCache('entities', entity.slug, 'minimal-embeds');

// Fetch fresh embeds from API
const response = await api.get<{ data: string[] }>(`/entities/${entity.slug}/embeds`);
const embedsData = response.data.data;
const embedsData = response.data.data || [];

// Store in localStorage
setEmbedCache('entities', entity.slug, embedsData, 'embeds');

// Fetch and cache minimal embeds as well
const minimalResponse = await api.get<{ data: string[] }>(`/entities/${entity.slug}/minimal-embeds`);
const minimalEmbedsData = minimalResponse.data.data || [];
setEmbedCache('entities', entity.slug, minimalEmbedsData, 'minimal-embeds');

// Update display
setEmbeds(embedsData);
setEmbedsError(null);
Expand Down
12 changes: 9 additions & 3 deletions src/components/EventDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,22 @@ export default function EventDetail({ slug, initialEvent }: { slug: string; init
setActionsMenuOpen(false);

try {
// Clear the old cache first
// Clear the old cache first (both standard and minimal embeds)
clearEmbedCache('events', event.slug, 'embeds');
clearEmbedCache('events', event.slug, 'minimal-embeds');

// Fetch fresh embeds from API
// Fetch fresh embeds from API (standard embeds)
const { data } = await api.get<{ data: string[] }>(`/events/${event.slug}/embeds`);
const embedsData = data.data;
const embedsData = data.data || [];

// Store in localStorage
setEmbedCache('events', event.slug, embedsData, 'embeds');

// Fetch and cache minimal embeds as well
const { data: minimalData } = await api.get<{ data: string[] }>(`/events/${event.slug}/minimal-embeds`);
const minimalEmbedsData = minimalData.data || [];
setEmbedCache('events', event.slug, minimalEmbedsData, 'minimal-embeds');

// Refetch to display the new data
await refetchEmbeds();

Expand Down