mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 22:03:45 +00:00
cheers
This commit is contained in:
parent
73734a23a1
commit
09d1b099b7
3 changed files with 30 additions and 2 deletions
|
|
@ -476,6 +476,9 @@ export class InteractiveMode {
|
|||
this.footerDataProvider.onBranchChange(() => {
|
||||
this.ui.requestRender();
|
||||
});
|
||||
|
||||
// Initialize available provider count for footer display
|
||||
await this.updateAvailableProviderCount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2781,6 +2784,13 @@ export class InteractiveMode {
|
|||
}
|
||||
}
|
||||
|
||||
/** Update the footer's available provider count from current model candidates */
|
||||
private async updateAvailableProviderCount(): Promise<void> {
|
||||
const models = await this.getModelCandidates();
|
||||
const uniqueProviders = new Set(models.map((m) => m.provider));
|
||||
this.footerDataProvider.setAvailableProviderCount(uniqueProviders.size);
|
||||
}
|
||||
|
||||
private showModelSelector(initialSearchInput?: string): void {
|
||||
this.showSelector((done) => {
|
||||
const selector = new ModelSelectorComponent(
|
||||
|
|
@ -3173,6 +3183,7 @@ export class InteractiveMode {
|
|||
try {
|
||||
this.session.modelRegistry.authStorage.logout(providerId);
|
||||
this.session.modelRegistry.refresh();
|
||||
await this.updateAvailableProviderCount();
|
||||
this.showStatus(`Logged out of ${providerName}`);
|
||||
} catch (error: unknown) {
|
||||
this.showError(`Logout failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||
|
|
@ -3267,6 +3278,7 @@ export class InteractiveMode {
|
|||
// Success
|
||||
restoreEditor();
|
||||
this.session.modelRegistry.refresh();
|
||||
await this.updateAvailableProviderCount();
|
||||
this.showStatus(`Logged in to ${providerName}. Credentials saved to ${getAuthPath()}`);
|
||||
} catch (error: unknown) {
|
||||
restoreEditor();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue