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