From 01fc98b221cbcdac8dbffd9a18bb9b6f81196a2c Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Thu, 3 Jul 2025 11:42:02 +0800 Subject: [PATCH] fix(AboutSettings): don't throw a notification when switch to the about page (#7688) refactor(AboutSettings): streamline test channel change handling - Moved the test channel change logic into a dedicated function to improve clarity and maintainability. - Removed the useEffect hook that was previously monitoring changes, simplifying the component's structure. --- src/renderer/src/pages/settings/AboutSettings.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/pages/settings/AboutSettings.tsx b/src/renderer/src/pages/settings/AboutSettings.tsx index 50832da2e6..bf8ab71ce1 100644 --- a/src/renderer/src/pages/settings/AboutSettings.tsx +++ b/src/renderer/src/pages/settings/AboutSettings.tsx @@ -102,13 +102,10 @@ const AboutSettings: FC = () => { { pattern: `-${UpgradeChannel.RC}.`, channel: UpgradeChannel.RC } ].find(({ pattern }) => version.includes(pattern))?.channel || UpgradeChannel.LATEST - useEffect(() => { - if (testPlan && currentChannelByVersion !== UpgradeChannel.LATEST && testChannel !== currentChannelByVersion) { + const handleTestChannelChange = async (value: UpgradeChannel) => { + if (testPlan && currentChannelByVersion !== UpgradeChannel.LATEST && value !== currentChannelByVersion) { window.message.warning(t('settings.general.test_plan.version_channel_not_match')) } - }, [testPlan, testChannel, currentChannelByVersion, t]) - - const handleTestChannelChange = async (value: UpgradeChannel) => { setTestChannel(value) // Clear update info when switching upgrade channel dispatch(