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.
This commit is contained in:
beyondkmp 2025-07-03 11:42:02 +08:00 committed by GitHub
parent 6c0b614208
commit 01fc98b221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(