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 776ea4f205
commit 0c22e29f69

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
}