mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 14:03:49 +00:00
Update existing tool components when toggling show-images setting
This commit is contained in:
parent
d4b2b4be04
commit
53794d78f2
2 changed files with 13 additions and 0 deletions
|
|
@ -80,6 +80,11 @@ export class ToolExecutionComponent extends Container {
|
|||
this.updateDisplay();
|
||||
}
|
||||
|
||||
setShowImages(show: boolean): void {
|
||||
this.showImages = show;
|
||||
this.updateDisplay();
|
||||
}
|
||||
|
||||
private updateDisplay(): void {
|
||||
const bgFn = this.result
|
||||
? this.result.isError
|
||||
|
|
|
|||
|
|
@ -1674,6 +1674,14 @@ export class InteractiveMode {
|
|||
this.settingsManager.setShowImages(newValue);
|
||||
this.showStatus(`Inline images: ${newValue ? "on" : "off"}`);
|
||||
this.chatContainer.removeChild(selector);
|
||||
|
||||
// Update all existing tool execution components with new setting
|
||||
for (const child of this.chatContainer.children) {
|
||||
if (child instanceof ToolExecutionComponent) {
|
||||
child.setShowImages(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
this.ui.setFocus(this.editor);
|
||||
this.ui.requestRender();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue