fix model info not updating on top right banner

This commit is contained in:
宇溯 2026-01-29 04:04:52 -08:00
parent 0e2eebc681
commit 2b91fdbc7f
2 changed files with 4 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import { Header } from './Header.js';
import { Tips } from './Tips.js';
import { useSettings } from '../contexts/SettingsContext.js';
import { useConfig } from '../contexts/ConfigContext.js';
import { useUIState } from '../contexts/UIStateContext.js';
interface AppHeaderProps {
version: string;
@ -17,10 +18,11 @@ interface AppHeaderProps {
export const AppHeader = ({ version }: AppHeaderProps) => {
const settings = useSettings();
const config = useConfig();
const uiState = useUIState();
const contentGeneratorConfig = config.getContentGeneratorConfig();
const authType = contentGeneratorConfig?.authType;
const model = config.getModel();
const model = uiState.currentModel; // Use currentModel from UIState instead of config.getModel()
const targetDir = config.getTargetDir();
const showBanner = !config.getScreenReader();
const showTips = !(settings.merged.ui?.hideTips || config.getScreenReader());

View file

@ -32,7 +32,7 @@ export const MainContent = () => {
return (
<>
<Static
key={uiState.historyRemountKey}
key={`${uiState.historyRemountKey}-${uiState.currentModel}`}
items={[
<AppHeader key="app-header" version={version} />,
...uiState.history.map((h) => (