MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / ensureActivitySpinner

Method ensureActivitySpinner

apps/kimi-code/src/tui/kimi-tui.ts:2557–2577  ·  view source on GitHub ↗
(
    style: SpinnerStyle,
    label = '',
    colorFn?: (s: string) => string,
  )

Source from the content-addressed store, hash-verified

2555 }
2556
2557 private ensureActivitySpinner(
2558 style: SpinnerStyle,
2559 label = '',
2560 colorFn?: (s: string) => string,
2561 ): MoonLoader {
2562 if (this.state.activitySpinner?.style !== style) {
2563 this.stopActivitySpinner();
2564 }
2565
2566 if (this.state.activitySpinner === null) {
2567 const instance = new MoonLoader(this.state.ui, style, colorFn, label);
2568 this.state.activitySpinner = { instance, style };
2569 return instance;
2570 }
2571
2572 this.state.activitySpinner.instance.setLabel(label);
2573 if (colorFn !== undefined) {
2574 this.state.activitySpinner.instance.setColorFn(colorFn);
2575 }
2576 return this.state.activitySpinner.instance;
2577 }
2578
2579 private stopActivitySpinner(): void {
2580 if (this.state.activitySpinner !== null) {

Callers 1

updateActivityPaneMethod · 0.95

Calls 3

stopActivitySpinnerMethod · 0.95
setColorFnMethod · 0.80
setLabelMethod · 0.65

Tested by

no test coverage detected