mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 10:34: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) {
|
for (const key in this.events) {
|
||||||
ipcMain.on(key, this.events[key])
|
ipcMain.on(key, this.events[key])
|
||||||
}
|
}
|
||||||
|
|
||||||
app.on("second-instance", this.handleOnSecondInstance)
|
app.on("second-instance", this.handleOnSecondInstance)
|
||||||
|
|
||||||
app.on("open-url", (event, url) => {
|
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 GoogleDriveAPI.init()
|
||||||
|
|
||||||
await this.createWindow()
|
await this.createWindow()
|
||||||
|
|
||||||
if (!isDev) {
|
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()
|
await autoUpdater.checkForUpdates()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ class App extends React.Component {
|
|||||||
"new:message": (event, data) => {
|
"new:message": (event, data) => {
|
||||||
antd.message[data.type || "info"](data.message)
|
antd.message[data.type || "info"](data.message)
|
||||||
},
|
},
|
||||||
"update-available": (event, data) => {
|
"app:update_available": (event, data) => {
|
||||||
this.onUpdateAvailable(data)
|
this.onUpdateAvailable(data)
|
||||||
},
|
},
|
||||||
"pkg:update_available": (event, data) => {
|
"pkg:update_available": (event, data) => {
|
||||||
|
@ -29,6 +29,7 @@ const Header = (props) => {
|
|||||||
size="small"
|
size="small"
|
||||||
icon={<Icons.MdDownload />}
|
icon={<Icons.MdDownload />}
|
||||||
onClick={app.applyUpdate}
|
onClick={app.applyUpdate}
|
||||||
|
type="primary"
|
||||||
>
|
>
|
||||||
Update now
|
Update now
|
||||||
</antd.Button>
|
</antd.Button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user