MCPcopy
hub / github.com/claude-code-best/claude-code / createAllTimeStatsPromise

Function createAllTimeStatsPromise

src/components/Stats.tsx:70–82  ·  view source on GitHub ↗

* Creates a stats loading promise that never rejects. * Always loads all-time stats for the heatmap.

()

Source from the content-addressed store, hash-verified

68 * Always loads all-time stats for the heatmap.
69 */
70function createAllTimeStatsPromise(): Promise<StatsResult> {
71 return aggregateClaudeCodeStatsForRange('all')
72 .then((data): StatsResult => {
73 if (!data || data.totalSessions === 0) {
74 return { type: 'empty' };
75 }
76 return { type: 'success', data };
77 })
78 .catch((err): StatsResult => {
79 const message = err instanceof Error ? err.message : 'Failed to load stats';
80 return { type: 'error', message };
81 });
82}
83
84export function Stats({ onClose }: Props): React.ReactNode {
85 // Always load all-time stats first (for heatmap)

Callers 1

StatsFunction · 0.85

Calls 1

Tested by

no test coverage detected