mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
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:
parent
776ea4f205
commit
0c22e29f69
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user