mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 22:03:45 +00:00
Footer shouldn't explode when no model is given.
This commit is contained in:
parent
e0c2745989
commit
112ce6e5d1
1 changed files with 2 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ export class FooterComponent {
|
|||
lastAssistantMessage.usage.cacheRead +
|
||||
lastAssistantMessage.usage.cacheWrite
|
||||
: 0;
|
||||
const contextWindow = this.state.model.contextWindow;
|
||||
const contextWindow = this.state.model?.contextWindow || 0;
|
||||
const contextPercent = contextWindow > 0 ? ((contextTokens / contextWindow) * 100).toFixed(1) : "0.0";
|
||||
|
||||
// Format token counts (similar to web-ui)
|
||||
|
|
@ -86,7 +86,7 @@ export class FooterComponent {
|
|||
const statsLeft = statsParts.join(" ");
|
||||
|
||||
// Add model name on the right side
|
||||
let modelName = this.state.model.id;
|
||||
let modelName = this.state.model?.id || "no-model";
|
||||
const statsLeftWidth = visibleWidth(statsLeft);
|
||||
const modelWidth = visibleWidth(modelName);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue