fix: first time download

This commit is contained in:
TaurusXin 2024-07-25 09:30:45 +08:00
parent b4e520958f
commit 7a62e7718e
1 changed files with 10 additions and 2 deletions

View File

@ -63,7 +63,15 @@ const Panel: React.FC = () => {
}
})
} else {
setCheckDisabled(true)
GetLatestVersion().then(res => {
if (res === null) {
toast('Get database failed.', {
description: '⛓️‍💥 Please check your internet connection.'
})
} else {
setNewVersion(res)
}
})
setMacInputDisabled(true)
setIsOpen(true)
}
@ -109,7 +117,7 @@ const Panel: React.FC = () => {
const handleCheck = () => {
setCheckDisabled(true)
GetLatestVersion().then(res => {
if (res.Version === null) {
if (res === null) {
setCheckDisabled(false)
toast('Check update failed.', {
description: '⛓️‍💥 Please check your internet connection.',