mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 21:32:56 -07:00
fix: clean up /clear and /resume (#22007)
This commit is contained in:
@@ -216,7 +216,17 @@ export const SessionStatsProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
});
|
||||
};
|
||||
|
||||
const handleClear = (newSessionId?: string) => {
|
||||
setStats((prevState) => ({
|
||||
...prevState,
|
||||
sessionId: newSessionId || prevState.sessionId,
|
||||
sessionStartTime: new Date(),
|
||||
promptCount: 0,
|
||||
}));
|
||||
};
|
||||
|
||||
uiTelemetryService.on('update', handleUpdate);
|
||||
uiTelemetryService.on('clear', handleClear);
|
||||
// Set initial state
|
||||
handleUpdate({
|
||||
metrics: uiTelemetryService.getMetrics(),
|
||||
@@ -225,6 +235,7 @@ export const SessionStatsProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
|
||||
return () => {
|
||||
uiTelemetryService.off('update', handleUpdate);
|
||||
uiTelemetryService.off('clear', handleClear);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user