fix: dry run (#566)

This commit is contained in:
Leyang 2025-04-15 17:46:28 +08:00 committed by GitHub
parent 3793e91899
commit 258dba3011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,7 @@
import { overrideAIConfig } from '@midscene/core/env';
import { Button, Tooltip } from 'antd';
import type React from 'react';
import { useEffect } from 'react';
import { EnvConfig } from '../env-config';
import { iconForStatus } from '../misc';
import { useEnvConfig } from '../store/store';
@ -24,7 +26,7 @@ const SWITCH_BUTTON_TEXT = {
export const ServiceModeControl: React.FC<ServiceModeControlProps> = ({
serviceMode,
}) => {
const { setServiceMode } = useEnvConfig();
const { setServiceMode, config } = useEnvConfig();
const serverValid = useServerValid(serviceMode === 'Server');
// Render server tip based on connection status
@ -69,6 +71,10 @@ export const ServiceModeControl: React.FC<ServiceModeControlProps> = ({
);
};
useEffect(() => {
overrideAIConfig(config);
}, [config]);
// Determine content based on service mode
const statusContent =
serviceMode === 'Server' ? renderServerTip() : <EnvConfig />;