mirror of
https://github.com/earendil-works/pi.git
synced 2026-06-18 15:54:04 +08:00
fix(tui): Trigger initial render when start() is called
The demos were not showing any output until user input because: - Components were added before ui.start() was called - addChild calls requestRender() but it returns early if \!isStarted - So no initial render happened until user input triggered one Now ui.start() triggers an initial render if components exist.
This commit is contained in:
@@ -238,6 +238,11 @@ export class TUI extends Container {
|
||||
} catch (error) {
|
||||
console.error("Error starting terminal:", error);
|
||||
}
|
||||
|
||||
// Trigger initial render if we have components
|
||||
if (this.children.length > 0) {
|
||||
this.requestRender();
|
||||
}
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
|
||||
Reference in New Issue
Block a user