mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
Improve tracking of animated components. (#12618)
This commit is contained in:
@@ -6,17 +6,15 @@
|
||||
|
||||
import Spinner from 'ink-spinner';
|
||||
import { type ComponentProps, useEffect } from 'react';
|
||||
|
||||
// A top-level field to track the total number of active spinners.
|
||||
export let debugNumSpinners = 0;
|
||||
import { debugState } from '../debug.js';
|
||||
|
||||
export type SpinnerProps = ComponentProps<typeof Spinner>;
|
||||
|
||||
export const CliSpinner = (props: SpinnerProps) => {
|
||||
useEffect(() => {
|
||||
debugNumSpinners++;
|
||||
debugState.debugNumAnimatedComponents++;
|
||||
return () => {
|
||||
debugNumSpinners--;
|
||||
debugState.debugNumAnimatedComponents--;
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user