fix: prevent update button from rendering when auto-check for updates… (#7212)

fix: prevent update button from rendering when auto-check for updates is disabled
This commit is contained in:
自由的世界人 2025-06-16 00:22:38 +08:00 committed by GitHub
parent acf78e8383
commit 68ae88dc1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
import { SyncOutlined } from '@ant-design/icons'
import { useRuntime } from '@renderer/hooks/useRuntime'
import { useSettings } from '@renderer/hooks/useSettings'
import { Button } from 'antd'
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
@ -7,13 +8,14 @@ import styled from 'styled-components'
const UpdateAppButton: FC = () => {
const { update } = useRuntime()
const { autoCheckUpdate } = useSettings()
const { t } = useTranslation()
if (!update) {
return null
}
if (!update.downloaded) {
if (!update.downloaded || !autoCheckUpdate) {
return null
}