mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 00:35:51 +00:00
fix: 修复 goalState.js 模块不存在的类型错误
This commit is contained in:
@@ -137,12 +137,14 @@ function GoalElapsedIndicator(): React.ReactNode {
|
|||||||
}, []);
|
}, []);
|
||||||
void tick;
|
void tick;
|
||||||
|
|
||||||
const { getGoal, getActiveElapsedMs } =
|
const goalModule = require('../../services/goal/goalState.js') as unknown as {
|
||||||
require('../../services/goal/goalState.js') as typeof import('../../services/goal/goalState.js');
|
getGoal: () => { status: string; [k: string]: unknown } | null;
|
||||||
const goal = getGoal();
|
getActiveElapsedMs: (g: { status: string; [k: string]: unknown }) => number;
|
||||||
|
};
|
||||||
|
const goal = goalModule.getGoal();
|
||||||
if (!goal) return null;
|
if (!goal) return null;
|
||||||
|
|
||||||
const elapsedMs = getActiveElapsedMs(goal);
|
const elapsedMs = goalModule.getActiveElapsedMs(goal);
|
||||||
const totalSeconds = Math.floor(elapsedMs / 1000);
|
const totalSeconds = Math.floor(elapsedMs / 1000);
|
||||||
const hours = Math.floor(totalSeconds / 3600);
|
const hours = Math.floor(totalSeconds / 3600);
|
||||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||||
@@ -429,7 +431,7 @@ function ModeIndicator({
|
|||||||
: []),
|
: []),
|
||||||
// Goal elapsed indicator — compact "goal (XhYmin)" after PID
|
// Goal elapsed indicator — compact "goal (XhYmin)" after PID
|
||||||
...(feature('GOAL') &&
|
...(feature('GOAL') &&
|
||||||
(require('../../services/goal/goalState.js') as typeof import('../../services/goal/goalState.js')).getGoal()
|
(require('../../services/goal/goalState.js') as unknown as { getGoal: () => unknown }).getGoal()
|
||||||
? [<GoalElapsedIndicator key="goal-elapsed" />]
|
? [<GoalElapsedIndicator key="goal-elapsed" />]
|
||||||
: []),
|
: []),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user