fix(AboutSettings.tsx): handle errors in update check by setting loading state

This commit is contained in:
kangfenmao 2024-08-05 16:15:58 +08:00
parent 8719d5c330
commit a39beb3841

View File

@ -20,7 +20,13 @@ const AboutSettings: FC = () => {
async () => {
if (checkUpdateLoading || downloading) return
setCheckUpdateLoading(true)
await window.api.checkForUpdate()
try {
await window.api.checkForUpdate()
} catch (error) {
setCheckUpdateLoading(false)
}
setCheckUpdateLoading(false)
},
2000,