mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 19:04:37 +00:00
feat: show (sub) indicator in footer when using OAuth subscription
This commit is contained in:
parent
8cd3151c2a
commit
bc838b021d
4 changed files with 69 additions and 4 deletions
|
|
@ -17,7 +17,7 @@ import {
|
|||
import { exec } from "child_process";
|
||||
import { getChangelogPath, parseChangelog } from "../changelog.js";
|
||||
import { exportSessionToHtml } from "../export-html.js";
|
||||
import { getApiKeyForModel, getAvailableModels } from "../model-config.js";
|
||||
import { getApiKeyForModel, getAvailableModels, invalidateOAuthCache } from "../model-config.js";
|
||||
import { listOAuthProviders, login, logout } from "../oauth/index.js";
|
||||
import type { SessionManager } from "../session-manager.js";
|
||||
import type { SettingsManager } from "../settings-manager.js";
|
||||
|
|
@ -1318,7 +1318,8 @@ export class TuiRenderer {
|
|||
},
|
||||
);
|
||||
|
||||
// Success
|
||||
// Success - invalidate OAuth cache so footer updates
|
||||
invalidateOAuthCache();
|
||||
this.chatContainer.addChild(new Spacer(1));
|
||||
this.chatContainer.addChild(
|
||||
new Text(theme.fg("success", `✓ Successfully logged in to ${providerId}`), 1, 0),
|
||||
|
|
@ -1335,6 +1336,8 @@ export class TuiRenderer {
|
|||
try {
|
||||
await logout(providerId);
|
||||
|
||||
// Invalidate OAuth cache so footer updates
|
||||
invalidateOAuthCache();
|
||||
this.chatContainer.addChild(new Spacer(1));
|
||||
this.chatContainer.addChild(
|
||||
new Text(theme.fg("success", `✓ Successfully logged out of ${providerId}`), 1, 0),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue