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