mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 02:24:18 +00:00
fix app update
This commit is contained in:
parent
d50ef87a5f
commit
abc65e6baa
@ -193,7 +193,7 @@ class ElectronApp {
|
||||
for (const key in this.events) {
|
||||
ipcMain.on(key, this.events[key])
|
||||
}
|
||||
|
||||
|
||||
app.on("second-instance", this.handleOnSecondInstance)
|
||||
|
||||
app.on("open-url", (event, url) => {
|
||||
@ -240,25 +240,25 @@ class ElectronApp {
|
||||
}
|
||||
}
|
||||
|
||||
autoUpdater.on("update-available", (ev, info) => {
|
||||
console.log(info)
|
||||
})
|
||||
|
||||
autoUpdater.on("error", (ev, err) => {
|
||||
console.error(err)
|
||||
})
|
||||
|
||||
autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
console.log(info)
|
||||
|
||||
sendToRender("update-available", info)
|
||||
})
|
||||
|
||||
await GoogleDriveAPI.init()
|
||||
|
||||
await this.createWindow()
|
||||
|
||||
if (!isDev) {
|
||||
autoUpdater.on("update-available", (ev, info) => {
|
||||
console.log(info)
|
||||
})
|
||||
|
||||
autoUpdater.on("error", (ev, err) => {
|
||||
console.error(err)
|
||||
})
|
||||
|
||||
autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
console.log(info)
|
||||
|
||||
sendToRender("app:update_available", info)
|
||||
})
|
||||
|
||||
await autoUpdater.checkForUpdates()
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class App extends React.Component {
|
||||
"new:message": (event, data) => {
|
||||
antd.message[data.type || "info"](data.message)
|
||||
},
|
||||
"update-available": (event, data) => {
|
||||
"app:update_available": (event, data) => {
|
||||
this.onUpdateAvailable(data)
|
||||
},
|
||||
"pkg:update_available": (event, data) => {
|
||||
|
@ -29,6 +29,7 @@ const Header = (props) => {
|
||||
size="small"
|
||||
icon={<Icons.MdDownload />}
|
||||
onClick={app.applyUpdate}
|
||||
type="primary"
|
||||
>
|
||||
Update now
|
||||
</antd.Button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user