diff --git a/src/services/indeehub-api.service.ts b/src/services/indeehub-api.service.ts index 0815b06..931c2d6 100644 --- a/src/services/indeehub-api.service.ts +++ b/src/services/indeehub-api.service.ts @@ -206,7 +206,8 @@ class IndeehubApiService { /** * Get zap stats for film cards (count, amount, recent zapper pubkeys) by project id. - * In dev, merges mock zap data for the first few projects so the UI is visible without real zaps. + * In dev, or when API returns empty (e.g. no zaps in DB yet), merges mock data so the zap UI is visible. + * Set VITE_HIDE_MOCK_ZAPS=true to never show mock zaps in production. */ async getZapStats(projectIds: string[]): Promise> { if (projectIds.length === 0) return {} @@ -221,7 +222,9 @@ class IndeehubApiService { } catch { data = {} } - if (import.meta.env.DEV) { + const hideMock = import.meta.env.VITE_HIDE_MOCK_ZAPS === 'true' + const shouldMock = !hideMock && (import.meta.env.DEV || Object.keys(data).length === 0) + if (shouldMock) { Object.assign(data, this.getMockZapStats(projectIds)) } return data