Skip to content

Commit

Permalink
Update V1.1.1 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugbot authored Jul 27, 2023
1 parent 625830e commit 2d41ecd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "genshin-locker",
"private": true,
"productName": "genshin-locker",
"version": "1.1.0",
"version": "1.1.1",
"description": "Genshin artifact scraper and manager",
"main": "packages/main/dist/index.cjs",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions packages/ipc-api/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const mainApi: MainAPI = {
if (!this.webContents) {
throw Error(`Message ${channel} was made before webContents was set.`)
}
if (this.webContents.isDestroyed()) {
throw Error(`Message ${channel} was made on destroyed webContents.`)
}
return this.webContents.send(channel, ...args)
},
handle(channel, listener) {
Expand Down
13 changes: 3 additions & 10 deletions packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { app } from 'electron'
import { platform } from 'node:process'
import { exit } from 'process'

import { autoUpdater } from 'electron-updater'

import { restoreOrCreateWindow } from './mainWindow'
import { setSecurityRestrictions } from './security-restrictions'

Expand Down Expand Up @@ -62,14 +64,5 @@ app
* Like `npm run compile` does. It's ok 😅
*/
if (import.meta.env.PROD) {
app
.whenReady()
.then(() => import('electron-updater'))
.then((module) => {
const autoUpdater =
module.autoUpdater ||
(module.default.autoUpdater as (typeof module)['autoUpdater'])
return autoUpdater.checkForUpdatesAndNotify()
})
.catch((e) => console.error('Failed check and install updates:', e))
app.whenReady().then(() => autoUpdater.checkForUpdatesAndNotify())
}

0 comments on commit 2d41ecd

Please sign in to comment.