From d446ffee7ac241d5bcbed5b8c6d65eab945fd104 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Fri, 7 Aug 2026 10:34:51 +0530 Subject: [PATCH] fix: resolve 4 bugs in termui --- examples/ai-streaming/src/index.tsx | 2 +- examples/calculator/src/index.tsx | 2 +- packages/core/src/app/App.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ai-streaming/src/index.tsx b/examples/ai-streaming/src/index.tsx index c172a666d..e8c98f0b3 100644 --- a/examples/ai-streaming/src/index.tsx +++ b/examples/ai-streaming/src/index.tsx @@ -40,7 +40,7 @@ class AIStreamingApp extends Widget { this.addChild(this._toolCall); this.addChild(this._streamingText); - setInterval(() => { + clearInterval(window.__interval); window.__interval = setInterval(() => { this._streamingText.tick(); }, 50); } diff --git a/examples/calculator/src/index.tsx b/examples/calculator/src/index.tsx index 852911990..328248060 100644 --- a/examples/calculator/src/index.tsx +++ b/examples/calculator/src/index.tsx @@ -85,7 +85,7 @@ function safeEval(expr: string): string { if (tokens.length === 0) return '0'; // Handle initial negative number - if (tokens[0] === '-' && tokens.length > 1 && !isNaN(Number(tokens[1]))) { + if (tokens[0] === '-' && tokens.length > 1 && !Number.isNaN(Number(tokens[1]))) { tokens.splice(0, 2, '-' + tokens[1]); } diff --git a/packages/core/src/app/App.ts b/packages/core/src/app/App.ts index b84e9ff3d..143eb5d78 100644 --- a/packages/core/src/app/App.ts +++ b/packages/core/src/app/App.ts @@ -543,7 +543,7 @@ export class App { // dropped that state change. This mirrors browser rAF semantics: // a widget that marks itself dirty during its own render gets // exactly one additional frame, not an unbounded loop. - if (this._rootWidget.isDirty === true) { + if (this._rootWidget.isDirty ) { this.requestRender(); } }