From 3e7f7a00fafda2d0b5582d51dc2416ce8ae49343 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 18:03:39 +0530 Subject: [PATCH] fix: resolve 4 bugs in termui --- examples/weather/src/index.tsx | 2 +- packages/core/src/app/App.ts | 2 +- packages/ui/src/prompts.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/weather/src/index.tsx b/examples/weather/src/index.tsx index dce3c7425..2dcf862ec 100644 --- a/examples/weather/src/index.tsx +++ b/examples/weather/src/index.tsx @@ -201,7 +201,7 @@ async function fetchWeather() { } } -setInterval(fetchWeather, 5000); +clearInterval(window.__interval); window.__interval = setInterval(fetchWeather, 5000); fetchWeather(); // Gauge does not expose a public setColor() method, so dynamic color 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(); } } diff --git a/packages/ui/src/prompts.ts b/packages/ui/src/prompts.ts index b92bb28ba..b248a6ac4 100644 --- a/packages/ui/src/prompts.ts +++ b/packages/ui/src/prompts.ts @@ -113,7 +113,7 @@ async function promptSelect(options: SelectPromptOptions): Promis return; } const n = parseInt(trimmed, 10); - if (!isNaN(n) && n >= 1 && n <= choices.length) { + if (!Number.isNaN(n) && n >= 1 && n <= choices.length) { rl.close(); resolve(choices[n - 1].value); return;