mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 20:20:57 +00:00
Merge pull request #1662 from QwenLM/fix/top-right-model-not-updating
fix(ui): resolve model not updating in top-right corner
This commit is contained in:
commit
d6a33dbe03
3 changed files with 5 additions and 2 deletions
|
|
@ -42,6 +42,7 @@ const createMockUIState = (overrides: Partial<UIState> = {}): UIState =>
|
|||
branchName: 'main',
|
||||
nightly: false,
|
||||
debugMessage: '',
|
||||
currentModel: 'gemini-pro',
|
||||
sessionStats: {
|
||||
lastPromptTokenCount: 0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
const targetDir = config.getTargetDir();
|
||||
const showBanner = !config.getScreenReader();
|
||||
const showTips = !(settings.merged.ui?.hideTips || config.getScreenReader());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export const MainContent = () => {
|
|||
return (
|
||||
<>
|
||||
<Static
|
||||
key={uiState.historyRemountKey}
|
||||
key={`${uiState.historyRemountKey}-${uiState.currentModel}`}
|
||||
items={[
|
||||
<AppHeader key="app-header" version={version} />,
|
||||
<DebugModeNotification key="debug-notification" />,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue