🔨 Refactor: simplify some functions

This commit is contained in:
萌萌哒赫萝
2023-05-21 10:41:03 +08:00
parent f8a886cefc
commit ca162a4c4c
2 changed files with 10 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
import db from '~/main/apis/core/datastore'
import { autoUpdater } from 'electron-updater'
const checkVersion = async () => {
const updateChecker = async () => {
let showTip = db.get('settings.showUpdateTip')
if (showTip === undefined) {
db.set('settings.showUpdateTip', true)
@@ -10,12 +10,8 @@ const checkVersion = async () => {
if (showTip) {
try {
await autoUpdater.checkForUpdatesAndNotify()
} catch (err) {
return false
}
} else {
return false
} catch (err) {}
}
}
export default checkVersion
export default updateChecker