2021-07-25 11:25:36 -04:00
|
|
|
import db from '~/main/apis/core/datastore'
|
2023-04-06 00:50:07 -04:00
|
|
|
import { autoUpdater } from 'electron-updater'
|
2017-12-23 03:38:19 -05:00
|
|
|
|
2023-05-20 22:41:03 -04:00
|
|
|
const updateChecker = async () => {
|
2019-09-11 07:30:08 -04:00
|
|
|
let showTip = db.get('settings.showUpdateTip')
|
2017-12-23 03:38:19 -05:00
|
|
|
if (showTip === undefined) {
|
2019-09-11 07:30:08 -04:00
|
|
|
db.set('settings.showUpdateTip', true)
|
2017-12-23 03:38:19 -05:00
|
|
|
showTip = true
|
|
|
|
}
|
|
|
|
if (showTip) {
|
2023-04-16 10:48:34 -04:00
|
|
|
try {
|
|
|
|
await autoUpdater.checkForUpdatesAndNotify()
|
2023-05-20 22:41:03 -04:00
|
|
|
} catch (err) {}
|
2017-12-23 03:38:19 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-20 22:41:03 -04:00
|
|
|
export default updateChecker
|