mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-02 18:39:06 +08:00
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:
parent
6c0b614208
commit
01fc98b221
@ -102,13 +102,10 @@ const AboutSettings: FC = () => {
|
|||||||
{ pattern: `-${UpgradeChannel.RC}.`, channel: UpgradeChannel.RC }
|
{ pattern: `-${UpgradeChannel.RC}.`, channel: UpgradeChannel.RC }
|
||||||
].find(({ pattern }) => version.includes(pattern))?.channel || UpgradeChannel.LATEST
|
].find(({ pattern }) => version.includes(pattern))?.channel || UpgradeChannel.LATEST
|
||||||
|
|
||||||
useEffect(() => {
|
const handleTestChannelChange = async (value: UpgradeChannel) => {
|
||||||
if (testPlan && currentChannelByVersion !== UpgradeChannel.LATEST && testChannel !== currentChannelByVersion) {
|
if (testPlan && currentChannelByVersion !== UpgradeChannel.LATEST && value !== currentChannelByVersion) {
|
||||||
window.message.warning(t('settings.general.test_plan.version_channel_not_match'))
|
window.message.warning(t('settings.general.test_plan.version_channel_not_match'))
|
||||||
}
|
}
|
||||||
}, [testPlan, testChannel, currentChannelByVersion, t])
|
|
||||||
|
|
||||||
const handleTestChannelChange = async (value: UpgradeChannel) => {
|
|
||||||
setTestChannel(value)
|
setTestChannel(value)
|
||||||
// Clear update info when switching upgrade channel
|
// Clear update info when switching upgrade channel
|
||||||
dispatch(
|
dispatch(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user