* Creates a stats loading promise that never rejects. * Always loads all-time stats for the heatmap.
()
| 62 | * Always loads all-time stats for the heatmap. |
| 63 | */ |
| 64 | function createAllTimeStatsPromise(): Promise<StatsResult> { |
| 65 | return aggregateClaudeCodeStatsForRange('all').then((data): StatsResult => { |
| 66 | if (!data || data.totalSessions === 0) { |
| 67 | return { |
| 68 | type: 'empty' |
| 69 | }; |
| 70 | } |
| 71 | return { |
| 72 | type: 'success', |
| 73 | data |
| 74 | }; |
| 75 | }).catch((err): StatsResult => { |
| 76 | const message = err instanceof Error ? err.message : 'Failed to load stats'; |
| 77 | return { |
| 78 | type: 'error', |
| 79 | message |
| 80 | }; |
| 81 | }); |
| 82 | } |
| 83 | export function Stats(t0) { |
| 84 | const $ = _c(4); |
| 85 | const { |
no test coverage detected