mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-26 02:30:18 +08:00
⚡ Perf: remove duplicate check of new version, refactor getLatestVersion func
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import db from '~/main/apis/core/datastore'
|
||||
import { getLatestVersion } from '#/utils/getLatestVersion'
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
// const releaseUrl = 'https://api.github.com/repos/Molunerfinn/PicGo/releases'
|
||||
// const releaseUrlBackup = 'https://picgo-1251750343.cos.ap-chengdu.myqcloud.com'
|
||||
// const downloadUrl = 'https://github.com/Kuingsmile/PicList/releases/latest'
|
||||
|
||||
const checkVersion = async () => {
|
||||
let showTip = db.get('settings.showUpdateTip')
|
||||
@@ -12,10 +8,9 @@ const checkVersion = async () => {
|
||||
showTip = true
|
||||
}
|
||||
if (showTip) {
|
||||
const res: string = await getLatestVersion()
|
||||
if (res !== '') {
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
} else {
|
||||
try {
|
||||
await autoUpdater.checkForUpdatesAndNotify()
|
||||
} catch (err) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user